﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CI_Admin.aspx.cs" Inherits="StreetSmartAdmin.CI_Admin" EnableEventValidation = "false" %>
<%@ Register TagPrefix="CustUserCtrl" TagName="Header" Src="Header.ascx" %>
<%@ Register TagPrefix="CustUserCtrl" TagName="Footer" Src="Footer.ascx" %>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<script language="javascript" type="text/javascript" src="WdatePicker.js"></script>
<head id="Head1" runat="server">
    <title>Street Smart Energy Admin</title>
    <link type="text/css" rel="stylesheet" href="style.css" />

    <script type="text/javascript">

        var _gaq = _gaq || [];
        _gaq.push(['_setAccount', 'UA-34609920-1']);
        _gaq.push(['_trackPageview']);

        (function () {
            var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
            ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
            var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
        })();

    </script>

</head>
<body>
    <form id="form1" runat="server">
        <CustUserCtrl:Header ID="Header" runat="server"></CustUserCtrl:Header>
        
    <div class="mGrid">
        <h1>C&I Form</h1>
        <center>
       
        <asp:Panel ID="panSearch" runat="server" DefaultButton="btnsearch" Width="100%" >
                <asp:Button ID="btnAddG1" runat="server" Text="Add New Record"  OnClick="btnAddG1_click"/>
                <asp:TextBox ID="searchBox" runat="server"  Font-Size="14px"></asp:TextBox>
                <asp:Button ID="btnsearch" runat="server" Text="Search"  onclick="btnsearch_Click" />
                <asp:Button ID="btnexport" runat="server" onclick="btnexport_Click" Text="Export" />
        </asp:Panel>  

        <asp:Label ID="Label17" runat="server" Text="Page size: "></asp:Label>
                <asp:DropDownList ID="ddlpage" runat="server" AutoPostBack="True">
                    <asp:ListItem>10</asp:ListItem>
                    <asp:ListItem>20</asp:ListItem>
                    <asp:ListItem Selected="True">50</asp:ListItem>
                    <asp:ListItem>100</asp:ListItem>
                </asp:DropDownList>

            <asp:Label ID="gridViewTotalRowCount" runat="server" Text=""></asp:Label>
            <asp:Label ID="Label19" runat="server" Text="records"></asp:Label>

        <asp:GridView ID="GridView1" runat="server" CssClass="mGrid" 
            PagerStyle-CssClass="pgr" AlternatingRowStyle-CssClass="alt" 
            DataSourceID="SqlDataSource1" AutoGenerateColumns="False" 
            DataKeyNames="USERID" AllowPaging="True" AllowSorting="True"
            onselectedindexchanged="GridView1_SelectedIndexChanged" 
            EnableModelValidation="True" PageSize="50">
            <AlternatingRowStyle CssClass="alt"></AlternatingRowStyle>
            <Columns>

                <asp:TemplateField ShowHeader="False">
                    <ItemTemplate>
                        <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" 
                            CommandName="Select" Text="Select"></asp:LinkButton>      
                    </ItemTemplate>

                </asp:TemplateField>
                <asp:TemplateField ShowHeader="False">
                    <ItemTemplate>
                        <asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" 
                            CommandName="Delete" Text="Delete" OnClientClick="return confirm('Are You Sure to Delete?')"></asp:LinkButton>
                </ItemTemplate>

                </asp:TemplateField>

                <asp:BoundField DataField="USERID" HeaderText="UserID" InsertVisible="False" 
                    ReadOnly="True" SortExpression="USERID" />


                <asp:BoundField DataField="OPERATOR" HeaderText="Operator" 
                    SortExpression="OPERATOR" />
                <asp:BoundField DataField="FIRST_NAME" HeaderText="First Name" 
                    SortExpression="FIRST_NAME" />
                <asp:BoundField DataField="LAST_NAME" HeaderText="Last Name" 
                    SortExpression="LAST_NAME" />
                <asp:BoundField DataField="COMPANY_NAME" HeaderText="Company Name" 
                    SortExpression="COMPANY_NAME" />
                <asp:BoundField DataField="EMAIL" HeaderText="Email" 
                    SortExpression="EMAIL" />
                <asp:BoundField DataField="BPHONE" 
                    HeaderText="Business Phone" SortExpression="BPHONE" />
                <asp:BoundField DataField="MOBILE" HeaderText="Mobile" 
                    SortExpression="MOBILE" />
                <asp:BoundField DataField="ELEC_STAT" HeaderText="Elec Status" 
                    SortExpression="ELEC_STAT" />
                <asp:BoundField DataField="GAS_STAT" HeaderText="Gas Status" 
                    SortExpression="GAS_STAT" />
                <asp:BoundField DataField="REGI_DATE" HeaderText="Registration Date" 
                    SortExpression="REGI_DATE" />
                <asp:BoundField DataField="DATE_CONV" 
                    HeaderText="Converted Date" 
                    SortExpression="DATE_CONV" />

                <asp:TemplateField HeaderText="Total Spend$">
                    <ItemTemplate>
                        <asp:Label ID="LabeluserID" runat="server" Text='<%# Bind("USERID") %>' 
                            Visible="False"></asp:Label>
                        <asp:SqlDataSource ID="SqlDataSource10" runat="server" 
                            ConnectionString="<%$ ConnectionStrings:SQLServer2005DBConnectionString %>" 
                            SelectCommand="SELECT SUM(PA_SPEND) AS SpentTotal FROM [tblCI_ELEC_SITE_DETAIL] WHERE ([USERID] = @USERID)">
                            <SelectParameters>
                                <asp:ControlParameter ControlID="LabeluserID" Name="USERID" PropertyName="Text" 
                                    Type="Int32" />
                            </SelectParameters>
                        </asp:SqlDataSource>
                        <asp:GridView ID="GridView6" runat="server" AutoGenerateColumns="False" 
                            DataSourceID="SqlDataSource10" EnableModelValidation="True"  
                            ShowHeader="False" BorderWidth="0px">
                            <Columns>
                                <asp:BoundField DataField="SpentTotal" HeaderText="SpentTotal" 
                                    SortExpression="SpentTotal" ReadOnly="True" />
                            </Columns>
                        </asp:GridView>
                    </ItemTemplate>
                </asp:TemplateField>

            </Columns>
            <PagerStyle CssClass="pgr"></PagerStyle>
        </asp:GridView>
<br/>
                


        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:SQLServer2005DBConnectionString %>" 
            OnSelected="SqlDataSource1_Selected"
             OnDeleted="SqlDataSource1_Deleted"
            DeleteCommand="DELETE FROM [tblCI] WHERE [USERID] = @original_USERID" 
            InsertCommand="INSERT INTO [tblCI] ([OPERATOR], [FIRST_NAME], [LAST_NAME], [COMPANY_NAME], [EMAIL], [BPHONE], [MOBILE], [DATE_CONV], [REGI_DATE], [ELEC_STAT], [GAS_STAT]) VALUES (@OPERATOR, @FIRST_NAME, @LAST_NAME, @COMPANY_NAME, @EMAIL, @BPHONE, @MOBILE, @DATE_CONV, @REGI_DATE, @ELEC_STAT, @GAS_STAT)" 
            OldValuesParameterFormatString="original_{0}" 
            SelectCommand="SELECT [USERID], [OPERATOR], [FIRST_NAME], [LAST_NAME], [COMPANY_NAME], [EMAIL], [BPHONE], [MOBILE], [DATE_CONV], [REGI_DATE], [ELEC_STAT], [GAS_STAT] FROM [tblCI] ORDER BY [USERID] DESC" 
            UpdateCommand="UPDATE [tblCI] SET [OPERATOR] = @OPERATOR, [FIRST_NAME] = @FIRST_NAME, [LAST_NAME] = @LAST_NAME, [COMPANY_NAME] = @COMPANY_NAME, [EMAIL] = @EMAIL, [BPHONE] = @BPHONE, [MOBILE] = @MOBILE, [DATE_CONV] = @DATE_CONV, [REGI_DATE] = @REGI_DATE, [ELEC_STAT] = @ELEC_STAT, [GAS_STAT] = @GAS_STAT WHERE [USERID] = @original_USERID"
            filterexpression="OPERATOR LIKE '%{0}%' or FIRST_NAME  LIKE '%{0}%' or ELEC_STAT  LIKE '%{0}%' or LAST_NAME  LIKE '%{0}%'  or COMPANY_NAME  LIKE '%{0}%'">
            <filterparameters>
                <asp:controlparameter controlid="searchBox" propertyname="Text" />
             </filterparameters>
            <DeleteParameters>
                <asp:Parameter Name="original_USERID" Type="Int32" />
            </DeleteParameters>
            <InsertParameters>
                <asp:Parameter Name="OPERATOR" Type="String" />
                <asp:Parameter Name="FIRST_NAME" Type="String" />
                <asp:Parameter Name="LAST_NAME" Type="String" />
                <asp:Parameter Name="COMPANY_NAME" Type="String" />
                <asp:Parameter Name="EMAIL" Type="String" />
                <asp:Parameter Name="BPHONE" Type="String" />
                <asp:Parameter Name="MOBILE" Type="String" />
                <asp:Parameter Name="DATE_CONV" Type="String" />
                <asp:Parameter Name="REGI_DATE" Type="DateTime" />
                <asp:Parameter Name="ELEC_STAT" Type="String" />
                <asp:Parameter Name="GAS_STAT" Type="String" />
            </InsertParameters>
            <UpdateParameters>
                <asp:Parameter Name="OPERATOR" Type="String" />
                <asp:Parameter Name="FIRST_NAME" Type="String" />
                <asp:Parameter Name="LAST_NAME" Type="String" />
                <asp:Parameter Name="COMPANY_NAME" Type="String" />
                <asp:Parameter Name="EMAIL" Type="String" />
                <asp:Parameter Name="BPHONE" Type="String" />
                <asp:Parameter Name="MOBILE" Type="String" />
                <asp:Parameter Name="DATE_CONV" Type="String" />
                <asp:Parameter Name="REGI_DATE" Type="DateTime" />
                <asp:Parameter Name="ELEC_STAT" Type="String" />
                <asp:Parameter Name="GAS_STAT" Type="String" />
                <asp:Parameter Name="original_USERID" Type="Int32" />
            </UpdateParameters>
        </asp:SqlDataSource>


        <asp:TextBox ID="tbid" runat="server" visible="false"></asp:TextBox>
        <asp:TextBox ID="tbtp" runat="server" visible="false"></asp:TextBox><br/>
        <asp:Label ID="lblupdate" runat="server" Text="" ForeColor="red"></asp:Label>

        </center>
        


        <asp:DetailsView ID="DetailsView1" runat="Server" DataSourceID="SqlDataSource2" 
            AllowPaging="True" AutoGenerateRows="False"
        DataKeyNames="userID" AutoGenerateInsertButton="True" DefaultMode="Edit" CssClass="mGrid"
        PagerStyle-CssClass="pgr" AlternatingRowStyle-CssClass="alt"  FieldHeaderStyle-Font-Bold="true" 
        Font-Names="Times New Roman" CommandRowStyle-Font-Size="13"   CommandRowStyle-ForeColor="red" 
            EnableModelValidation="True" OnItemInserted="DetailsView1_ItemInserted"
            OnItemUpdated="DetailsView1_ItemUpdated">  
        <AlternatingRowStyle CssClass="alt"></AlternatingRowStyle>

<CommandRowStyle Font-Size="13pt"></CommandRowStyle>

        <Fields>
        

                <asp:TemplateField HeaderText="USERID"
                    SortExpression="USERID">
                    <InsertItemTemplate>
                     <asp:Label ID="lbluserID" runat="server" Text='<%# Eval("USERID") %>'></asp:Label>
                    </InsertItemTemplate>
                    <EditItemTemplate>
                        <asp:Label ID="lbluserID" runat="server" Text='<%# Eval("USERID") %>'></asp:Label>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="lbluserID" runat="server" Text='<%# Bind("USERID") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="General Details" HeaderStyle-Font-Size="Large">

<HeaderStyle Font-Size="Large"></HeaderStyle>

                </asp:TemplateField>



                <asp:TemplateField HeaderText="Registration Date" SortExpression="REGI_DATE" >
                    <EditItemTemplate>
                        <asp:Label ID="REGI_DATE" runat="server" Text='<%# Bind("REGI_DATE") %>'></asp:Label>
                    </EditItemTemplate>
                    <InsertItemTemplate>

                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="REGI_DATE" runat="server" Text='<%# Bind("REGI_DATE") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>

                <asp:TemplateField HeaderText="Organisation Type">
                    <EditItemTemplate>
                        <asp:Label ID="ORGA_TYPE" runat="server" Text='C&I'></asp:Label>
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:Label ID="ORGA_TYPE" runat="server" Text='C&I'></asp:Label>
                    </InsertItemTemplate>
                    <ItemTemplate>

                    </ItemTemplate>
                </asp:TemplateField>

                <asp:TemplateField HeaderText="Operator/Manager/Agent " SortExpression="OPERATOR">
                    <EditItemTemplate>
                        <asp:TextBox ID="OPERATOR" runat="server" Text='<%# Bind("OPERATOR") %>'></asp:TextBox>
       
                        <asp:DropDownList name="selOPERATOR" ID="selOPERATOR" runat="Server" HeaderText="Operator SSE" onchange="selOPERATORChanged()"
                                     DataSourceID="SqlDataSource36" DataTextField="OperatorName" DataValueField="OperatorName" />


                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:TextBox ID="OPERATOR" runat="server" Text='<%# Bind("OPERATOR") %>'></asp:TextBox>
       
                        <asp:DropDownList name="selOPERATOR" ID="selOPERATOR" runat="Server" HeaderText="Operator SSE" onchange="selOPERATORChanged()"
                                     DataSourceID="SqlDataSource36" DataTextField="OperatorName" DataValueField="OperatorName" />


                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label7" runat="server" Text='<%# Bind("OPERATOR") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>



                <asp:TemplateField HeaderText="Electricity Account Status" SortExpression="ELEC_STAT">
                    <EditItemTemplate>

                    
                        <asp:DropDownList ID="selELEC_STAT" runat="Server" SelectedValue='<%# Bind("ELEC_STAT") %>' onchange="selSTATChanged('div_STTS_ELEC',this.id)">
                            <asp:ListItem Value="">Select...</asp:ListItem>
                            <asp:ListItem>New Customer</asp:ListItem>
                            <asp:ListItem>Call back customer</asp:ListItem>
                            <asp:ListItem>Waiting for detail from the customer</asp:ListItem>
                            <asp:ListItem>Pricing proposal In progress Pending</asp:ListItem>
                            <asp:ListItem>Proposals forwarded to customer</asp:ListItem>
                            <asp:ListItem>Customer rejected offer - requires requote</asp:ListItem>
                            <asp:ListItem>Customer rejected offer no requote / feedback</asp:ListItem>
                            <asp:ListItem>Customer currently with another retailer</asp:ListItem>
                            <asp:ListItem>Customer lost  have accepted offer with another retailer</asp:ListItem>
                            <asp:ListItem>Customer converted / accepted offer</asp:ListItem>
                        </asp:DropDownList> <br/>

                        <div id='div_STTS_ELEC'>
                        <table border="0">
                        <tr>
                            <td>Winning Retailer:

                            <asp:TextBox ID="STTS_WINNER_ELEC" runat="server" Text='<%# Bind("STTS_WINNER_ELEC") %>'></asp:TextBox>
       
                            <asp:DropDownList ID="SelSTTS_WINNER_ELEC" runat="Server" onchange="SelSTTS_WINNER_ELECChanged()"
                                DataSourceID="SqlDataSource9" DataTextField="CurrentProviderName" DataValueField="CurrentProviderName" />


                            </td>
                            <td>Start Date:
                            <asp:TextBox ID="STTS_START_ELEC" runat="server" Text='<%# Bind("STTS_START_ELEC") %>'   onclick="WdatePicker()"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                            Contract Term:
                            <asp:DropDownList ID="SelSTTS_TERM_ELEC" runat="server" 
                                        SelectedValue='<%# Bind("STTS_TERM_ELEC") %>'>
                                        <asp:ListItem Value="">Select...</asp:ListItem>
                                        <asp:ListItem>1</asp:ListItem>
                                        <asp:ListItem>2</asp:ListItem>
                                        <asp:ListItem>3</asp:ListItem>
                                        <asp:ListItem>4</asp:ListItem>
                                        <asp:ListItem>5</asp:ListItem>
                                        <asp:ListItem>6</asp:ListItem>
                                    </asp:DropDownList>
                            <asp:Label ID="lblSelSTTS_TERM_ELEC" runat="server" Text="Year"></asp:Label>
                            </td>
                            <td>End Date:
                            <asp:TextBox ID="STTS_END_ELEC" runat="server" Text='<%# Bind("STTS_END_ELEC") %>'   onclick="WdatePicker()"></asp:TextBox>
                            </td>
                        </tr>
                        </table>
                        

                        </div>


                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:DropDownList ID="selELEC_STAT" runat="Server" SelectedValue='<%# Bind("ELEC_STAT") %>'  onchange="selSTATChanged('div_STTS_ELEC',this.id)">
                            <asp:ListItem Value="">Select...</asp:ListItem>
                            <asp:ListItem>New Customer</asp:ListItem>
                            <asp:ListItem>Call back customer</asp:ListItem>
                            <asp:ListItem>Waiting for detail from the customer</asp:ListItem>
                            <asp:ListItem>Pricing proposal In progress Pending</asp:ListItem>
                            <asp:ListItem>Proposals forwarded to customer</asp:ListItem>
                            <asp:ListItem>Customer rejected offer - requires requote</asp:ListItem>
                            <asp:ListItem>Customer rejected offer no requote / feedback</asp:ListItem>
                            <asp:ListItem>Customer currently with another retailer</asp:ListItem>
                            <asp:ListItem>Customer lost  have accepted offer with another retailer</asp:ListItem>
                            <asp:ListItem>Customer converted / accepted offer</asp:ListItem>
                        </asp:DropDownList> <br/>

                        <div id='div_STTS_ELEC'>
                        <table border="0">
                        <tr>
                            <td>Winning Retailer:

                            <asp:TextBox ID="STTS_WINNER_ELEC" runat="server" Text='<%# Bind("STTS_WINNER_ELEC") %>'></asp:TextBox>
       
                            <asp:DropDownList ID="SelSTTS_WINNER_ELEC" runat="Server" onchange="SelSTTS_WINNER_ELECChanged()"
                                DataSourceID="SqlDataSource9" DataTextField="CurrentProviderName" DataValueField="CurrentProviderName" />



                            </td>
                            <td>Start Date:
                            <asp:TextBox ID="STTS_START_ELEC" runat="server" Text='<%# Bind("STTS_START_ELEC") %>'   onclick="WdatePicker()"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                            Contract Term:
                            <asp:DropDownList ID="SelSTTS_TERM_ELEC" runat="server" 
                                        SelectedValue='<%# Bind("STTS_TERM_ELEC") %>'>
                                        <asp:ListItem Value="">Select...</asp:ListItem>
                                        <asp:ListItem>1</asp:ListItem>
                                        <asp:ListItem>2</asp:ListItem>
                                        <asp:ListItem>3</asp:ListItem>
                                        <asp:ListItem>4</asp:ListItem>
                                        <asp:ListItem>5</asp:ListItem>
                                        <asp:ListItem>6</asp:ListItem>
                                    </asp:DropDownList>
                            <asp:Label ID="lblSelSTTS_TERM_ELEC" runat="server" Text="Year"></asp:Label>
                            </td>
                            <td>End Date:
                            <asp:TextBox ID="STTS_END_ELEC" runat="server" Text='<%# Bind("STTS_END_ELEC") %>'   onclick="WdatePicker()"></asp:TextBox>
                            </td>
                        </tr>
                        </table>
                        
                        </div>




                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label5" runat="server" Text='<%# Bind("ELEC_STAT") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Gas Account Status" SortExpression="GAS_STAT">
                    <EditItemTemplate>

                        <asp:DropDownList ID="selGAS_STAT" runat="Server" SelectedValue='<%# Bind("GAS_STAT") %>'  onchange="selSTATChanged('div_STTS_GAS',this.id)">
                            <asp:ListItem Value="">Select...</asp:ListItem>
                            <asp:ListItem>New Customer</asp:ListItem>
                            <asp:ListItem>Call back customer</asp:ListItem>
                            <asp:ListItem>Waiting for detail from the customer</asp:ListItem>
                            <asp:ListItem>Pricing proposal In progress Pending</asp:ListItem>
                            <asp:ListItem>Proposals forwarded to customer</asp:ListItem>
                            <asp:ListItem>Customer rejected offer - requires requote</asp:ListItem>
                            <asp:ListItem>Customer rejected offer no requote / feedback</asp:ListItem>
                            <asp:ListItem>Customer currently with another retailer</asp:ListItem>
                            <asp:ListItem>Customer lost  have accepted offer with another retailer</asp:ListItem>
                            <asp:ListItem>Customer converted / accepted offer</asp:ListItem>
                        </asp:DropDownList> <br/>
                    
                        <div id='div_STTS_GAS'>

                        <table border="0">
                        <tr>
                            <td>Winning Retailer:

                            <asp:TextBox ID="STTS_WINNER_GAS" runat="server" Text='<%# Bind("STTS_WINNER_GAS") %>'></asp:TextBox>
       
                            <asp:DropDownList ID="SelSTTS_WINNER_GAS" runat="Server" onchange="SelSTTS_WINNER_GASChanged()"
                                DataSourceID="SqlDataSource9" DataTextField="CurrentProviderName" DataValueField="CurrentProviderName" />


                            </td>
                            <td>Start Date:
                            <asp:TextBox ID="STTS_START_GAS" runat="server" Text='<%# Bind("STTS_START_GAS") %>'   onclick="WdatePicker()"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                            Contract Term:
                            <asp:DropDownList ID="SelSTTS_TERM_GAS" runat="server" 
                                        SelectedValue='<%# Bind("STTS_TERM_GAS") %>'>
                                        <asp:ListItem Value="">Select...</asp:ListItem>
                                        <asp:ListItem>1</asp:ListItem>
                                        <asp:ListItem>2</asp:ListItem>
                                        <asp:ListItem>3</asp:ListItem>
                                        <asp:ListItem>4</asp:ListItem>
                                        <asp:ListItem>5</asp:ListItem>
                                        <asp:ListItem>6</asp:ListItem>
                                    </asp:DropDownList>
                            <asp:Label ID="lblSelSTTS_TERM_GAS" runat="server" Text="Year"></asp:Label>
                            </td>
                            <td>End Date:
                            <asp:TextBox ID="STTS_END_GAS" runat="server" Text='<%# Bind("STTS_END_GAS") %>'   onclick="WdatePicker()"></asp:TextBox>
                            </td>
                        </tr>
                        </table>


                        </div>

                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:DropDownList ID="selGAS_STAT" runat="Server" SelectedValue='<%# Bind("GAS_STAT") %>'  onchange="selSTATChanged('div_STTS_GAS',this.id)">
                            <asp:ListItem Value="">Select...</asp:ListItem>
                            <asp:ListItem>New Customer</asp:ListItem>
                            <asp:ListItem>Call back customer</asp:ListItem>
                            <asp:ListItem>Waiting for detail from the customer</asp:ListItem>
                            <asp:ListItem>Pricing proposal In progress Pending</asp:ListItem>
                            <asp:ListItem>Proposals forwarded to customer</asp:ListItem>
                            <asp:ListItem>Customer rejected offer - requires requote</asp:ListItem>
                            <asp:ListItem>Customer rejected offer no requote / feedback</asp:ListItem>
                            <asp:ListItem>Customer currently with another retailer</asp:ListItem>
                            <asp:ListItem>Customer lost  have accepted offer with another retailer</asp:ListItem>
                            <asp:ListItem>Customer converted / accepted offer</asp:ListItem>
                        </asp:DropDownList> <br/>

                        <div id='div_STTS_GAS'>
                        <table border="0">
                        <tr>
                            <td>Winning Retailer:
                     
                            <asp:TextBox ID="STTS_WINNER_GAS" runat="server" Text='<%# Bind("STTS_WINNER_GAS") %>'></asp:TextBox>
       
                            <asp:DropDownList ID="DropDownList1" runat="Server" onchange="SelSTTS_WINNER_GASChanged()"
                                DataSourceID="SqlDataSource9" DataTextField="CurrentProviderName" DataValueField="CurrentProviderName" />


                            </td>
                            <td>Start Date:
                            <asp:TextBox ID="STTS_START_GAS" runat="server" Text='<%# Bind("STTS_START_GAS") %>'   onclick="WdatePicker()"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                            Contract Term:
                            <asp:DropDownList ID="SelSTTS_TERM_GAS" runat="server" 
                                        SelectedValue='<%# Bind("STTS_TERM_GAS") %>'>
                                        <asp:ListItem Value="">Select...</asp:ListItem>
                                        <asp:ListItem>1</asp:ListItem>
                                        <asp:ListItem>2</asp:ListItem>
                                        <asp:ListItem>3</asp:ListItem>
                                        <asp:ListItem>4</asp:ListItem>
                                        <asp:ListItem>5</asp:ListItem>
                                        <asp:ListItem>6</asp:ListItem>
                                    </asp:DropDownList>
                            <asp:Label ID="lblSelSTTS_TERM_GAS" runat="server" Text="Year"></asp:Label>
                            </td>
                            <td>End Date:
                            <asp:TextBox ID="STTS_END_GAS" runat="server" Text='<%# Bind("STTS_END_GAS") %>'   onclick="WdatePicker()"></asp:TextBox>
                            </td>
                        </tr>
                        </table>
                        
                        </div>


                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label6" runat="server" Text='<%# Bind("GAS_STAT") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>

                <asp:TemplateField HeaderText="Preferred Day to contact" SortExpression="PREF_DAY">
                    <EditItemTemplate>
                        <asp:TextBox ID="PREF_DAY" runat="server" Text='<%# Bind("PREF_DAY") %>'   onclick="WdatePicker()"></asp:TextBox>


                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:TextBox ID="PREF_DAY" runat="server" Text='<%# Bind("PREF_DAY") %>'   onclick="WdatePicker()"></asp:TextBox>

                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label9" runat="server" Text='<%# Bind("PREF_DAY") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Preferred Time to Contact" SortExpression="PREF_TIME">
                    <EditItemTemplate>
                        <asp:DropDownList name="selPreferredTime" ID="selPreferredTime" runat="Server" SelectedValue='<%# Bind("PREF_TIME") %>' >
                            <asp:ListItem Value="">Select...</asp:ListItem>
                            <asp:ListItem Value="8:00 AM - 9:00 AM">8:00 AM - 9:00 AM</asp:ListItem>
                            <asp:ListItem Value="9:00 AM - 10:00 AM">9:00 AM - 10:00 AM</asp:ListItem>
                            <asp:ListItem Value="10:00 AM - 11:00 AM">10:00 AM - 11:00 AM</asp:ListItem>
                            <asp:ListItem Value="11:00 AM - 12:00 AM">11:00 AM - 12:00 AM</asp:ListItem>
                            <asp:ListItem Value="12:00 AM - 1:00 PM">12:00 AM - 1:00 PM</asp:ListItem>
                            <asp:ListItem Value="1:00 PM - 2:00 PM">1:00 PM - 2:00 PM</asp:ListItem>
                            <asp:ListItem Value="2:00 PM - 3:00 PM">2:00 PM - 3:00 PM</asp:ListItem>
                            <asp:ListItem Value="3:00 PM - 4:00 PM">3:00 PM - 4:00 PM</asp:ListItem>
                            <asp:ListItem Value="4:00 PM - 5:00 PM">4:00 PM - 5:00 PM</asp:ListItem>
                            <asp:ListItem Value="5:00 PM - 6:00 PM">5:00 PM - 6:00 PM</asp:ListItem>
                            <asp:ListItem Value="6:00 PM - 7:00 PM">6:00 PM - 7:00 PM</asp:ListItem>
                            <asp:ListItem Value="7:00 PM - 8:00 PM">7:00 PM - 8:00 PM</asp:ListItem>
                            <asp:ListItem Value="8:00 PM - 9:00 PM">8:00 PM - 9:00 PM</asp:ListItem>
                        </asp:DropDownList> 

                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:DropDownList name="selPreferredTime" ID="selPreferredTime" runat="Server" SelectedValue='<%# Bind("PREF_TIME") %>' >
                            <asp:ListItem Value="">Select...</asp:ListItem>
                            <asp:ListItem Value="8:00 AM - 9:00 AM">8:00 AM - 9:00 AM</asp:ListItem>
                            <asp:ListItem Value="9:00 AM - 10:00 AM">9:00 AM - 10:00 AM</asp:ListItem>
                            <asp:ListItem Value="10:00 AM - 11:00 AM">10:00 AM - 11:00 AM</asp:ListItem>
                            <asp:ListItem Value="11:00 AM - 12:00 AM">11:00 AM - 12:00 AM</asp:ListItem>
                            <asp:ListItem Value="12:00 AM - 1:00 PM">12:00 AM - 1:00 PM</asp:ListItem>
                            <asp:ListItem Value="1:00 PM - 2:00 PM">1:00 PM - 2:00 PM</asp:ListItem>
                            <asp:ListItem Value="2:00 PM - 3:00 PM">2:00 PM - 3:00 PM</asp:ListItem>
                            <asp:ListItem Value="3:00 PM - 4:00 PM">3:00 PM - 4:00 PM</asp:ListItem>
                            <asp:ListItem Value="4:00 PM - 5:00 PM">4:00 PM - 5:00 PM</asp:ListItem>
                            <asp:ListItem Value="5:00 PM - 6:00 PM">5:00 PM - 6:00 PM</asp:ListItem>
                            <asp:ListItem Value="6:00 PM - 7:00 PM">6:00 PM - 7:00 PM</asp:ListItem>
                            <asp:ListItem Value="7:00 PM - 8:00 PM">7:00 PM - 8:00 PM</asp:ListItem>
                            <asp:ListItem Value="8:00 PM - 9:00 PM">8:00 PM - 9:00 PM</asp:ListItem>
                        </asp:DropDownList> 
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label10" runat="server" Text='<%# Bind("PREF_TIME") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>


                <asp:TemplateField HeaderText="Date Converted" SortExpression="DATE_CONV">
                    <EditItemTemplate>
                        <asp:TextBox ID="DATE_CONV" runat="server" Text='<%# Bind("DATE_CONV") %>'  onclick="WdatePicker()"></asp:TextBox>
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:TextBox ID="DATE_CONV" runat="server" Text='<%# Bind("DATE_CONV") %>'  onclick="WdatePicker()"></asp:TextBox>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label4" runat="server" Text='<%# Bind("DATE_CONV") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>

                <asp:TemplateField HeaderText="Comments" SortExpression="COMMENT">
                    <EditItemTemplate>

                        Add Comment<input type="text" id="addcomments" size="75" />
                        <asp:TextBox ID="Comments" Rows="5" cols="40" Width="97%" runat="server" TextMode="MultiLine"
                            Text='<%# Bind("COMMENT") %>'></asp:TextBox>

                    </EditItemTemplate>
                    <InsertItemTemplate>
                        Add Notes<input type="text" id="addcomments" size="75" />
                        <asp:TextBox ID="Comments" Rows="5" cols="40" Width="97%" runat="server" TextMode="MultiLine"
                            Text='<%# Bind("COMMENT") %>'></asp:TextBox>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label8" runat="server" Text='<%# Bind("COMMENT") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>




                <asp:TemplateField HeaderText="Promotion Code" SortExpression="PROM_CODE">
                    <EditItemTemplate>
                        

                        <asp:TextBox ID="PromotionCode" runat="server" Text='<%# Bind("PROM_CODE") %>' visible="true"></asp:TextBox>
                        <asp:DropDownList name="selPromotionCode" ID="selPromotionCode" runat="Server" DataSourceID="SqlDataSource35"
                            DataTextField="PromotionCodeName" DataValueField="PromotionCodeName" onchange="PromotionCodeChanged()"> 
                        </asp:DropDownList>   


                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:TextBox ID="PromotionCode" runat="server" Text='<%# Bind("PROM_CODE") %>' visible="true"></asp:TextBox>
                        <asp:DropDownList name="selPromotionCode" ID="selPromotionCode" runat="Server" DataSourceID="SqlDataSource35"
                            DataTextField="PromotionCodeName" DataValueField="PromotionCodeName" onchange="PromotionCodeChanged()"> 
                        </asp:DropDownList>   


                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label11" runat="server" Text='<%# Bind("PROM_CODE") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Lead Source Code" SortExpression="LEAD_CODE">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox11" runat="server" Text='<%# Bind("LEAD_CODE") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:TextBox ID="TextBox12" runat="server" Text='<%# Bind("LEAD_CODE") %>'></asp:TextBox>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label12" runat="server" Text='<%# Bind("LEAD_CODE") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Commission Fee" SortExpression="ADMIN_FEE">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox12" runat="server" Text='<%# Bind("ADMIN_FEE") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:TextBox ID="TextBox13" runat="server" Text='<%# Bind("ADMIN_FEE") %>'></asp:TextBox>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label13" runat="server" Text='<%# Bind("ADMIN_FEE") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Vendor ID" SortExpression="VENDOR_ID">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox13" runat="server" Text='<%# Bind("VENDOR_ID") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:TextBox ID="TextBox14" runat="server" Text='<%# Bind("VENDOR_ID") %>'></asp:TextBox>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label14" runat="server" Text='<%# Bind("VENDOR_ID") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Customer Details" HeaderStyle-Font-Size="Large">

                </asp:TemplateField>

                <asp:TemplateField HeaderText="Registered Company Name:" SortExpression="COMPANY_NAME">
                    <EditItemTemplate>
                        <asp:TextBox ID="COMPANY_NAME" runat="server" Text='<%# Bind("COMPANY_NAME") %>' Width="400px"></asp:TextBox>
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:TextBox ID="COMPANY_NAME" runat="server" Text='<%# Bind("COMPANY_NAME") %>' Width="400px"></asp:TextBox>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label15" runat="server" Text='<%# Bind("COMPANY_NAME") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Business Type" SortExpression="BUSINESS_TYPE">
                    <EditItemTemplate>
                        <asp:DropDownList ID="SelBUSINESS_TYPE" runat="server" SelectedValue='<%# Bind("BUSINESS_TYPE") %>'>
                                            <asp:ListItem Value="">Select...</asp:ListItem>
                                            <asp:ListItem>Accommodation, Cafes and Restaurants</asp:ListItem>
                                            <asp:ListItem>Agriculture, Forestry and Fishing</asp:ListItem>
                                            <asp:ListItem>Communication Services</asp:ListItem>
                                            <asp:ListItem>Construction</asp:ListItem>
                                            <asp:ListItem>Cultural and Recreational Services</asp:ListItem>
                                            <asp:ListItem>Education</asp:ListItem>
                                            <asp:ListItem>Electricity, Gas and Water Supply</asp:ListItem>
                                            <asp:ListItem>Finance and Insurance</asp:ListItem>
                                            <asp:ListItem>Government Administration and Defence</asp:ListItem>
                                            <asp:ListItem>Health and Community Services</asp:ListItem>
                                            <asp:ListItem>Manufacturing</asp:ListItem>
                                            <asp:ListItem>Mining</asp:ListItem>
                                            <asp:ListItem>Personal and Other Services</asp:ListItem>
                                            <asp:ListItem>Property and Business Services</asp:ListItem>
                                            <asp:ListItem>Pubs and Clubs</asp:ListItem>
                                            <asp:ListItem>Retail Trade</asp:ListItem>
                                            <asp:ListItem>Transport and Storage</asp:ListItem>
                                            <asp:ListItem>Wholesale Trade</asp:ListItem>

                        </asp:DropDownList>
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:DropDownList ID="SelBUSINESS_TYPE" runat="server" SelectedValue='<%# Bind("BUSINESS_TYPE") %>'>
                                            <asp:ListItem Value="">Select...</asp:ListItem>
                                            <asp:ListItem>Accommodation, Cafes and Restaurants</asp:ListItem>
                                            <asp:ListItem>Agriculture, Forestry and Fishing</asp:ListItem>
                                            <asp:ListItem>Communication Services</asp:ListItem>
                                            <asp:ListItem>Construction</asp:ListItem>
                                            <asp:ListItem>Cultural and Recreational Services</asp:ListItem>
                                            <asp:ListItem>Education</asp:ListItem>
                                            <asp:ListItem>Electricity, Gas and Water Supply</asp:ListItem>
                                            <asp:ListItem>Finance and Insurance</asp:ListItem>
                                            <asp:ListItem>Government Administration and Defence</asp:ListItem>
                                            <asp:ListItem>Health and Community Services</asp:ListItem>
                                            <asp:ListItem>Manufacturing</asp:ListItem>
                                            <asp:ListItem>Mining</asp:ListItem>
                                            <asp:ListItem>Personal and Other Services</asp:ListItem>
                                            <asp:ListItem>Property and Business Services</asp:ListItem>
                                            <asp:ListItem>Pubs and Clubs</asp:ListItem>
                                            <asp:ListItem>Retail Trade</asp:ListItem>
                                            <asp:ListItem>Transport and Storage</asp:ListItem>
                                            <asp:ListItem>Wholesale Trade</asp:ListItem>
                        </asp:DropDownList>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label32" runat="server" Text='<%# Bind("BUSINESS_TYPE") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>

                <asp:TemplateField HeaderText="Utility requirements" SortExpression="FUEL_TYPE" ItemStyle-Font-Size="12">
                    <EditItemTemplate>
                    <asp:RadioButtonList ID="selFUEL_TYPE" runat="server" RepeatDirection="Horizontal" RepeatLayout="Table" AutoPostBack="true"
                        onselectedindexchanged="selFUEL_TYPE_SelectedIndexChanged" SelectedValue='<%# Bind("FUEL_TYPE") %>'>
                        <asp:ListItem Value="">None</asp:ListItem>
                        <asp:ListItem Value="Electricity">Electricity</asp:ListItem>
                        <asp:ListItem Value="Gas">Gas</asp:ListItem>
                        <asp:ListItem Value="Dual">Both</asp:ListItem>
                    </asp:RadioButtonList>

                    </EditItemTemplate>
                    <InsertItemTemplate>
                    <asp:RadioButtonList ID="selFUEL_TYPE" runat="server" RepeatDirection="Horizontal" RepeatLayout="Table" 
                        onselectedindexchanged="selFUEL_TYPE_SelectedIndexChanged" SelectedValue='<%# Bind("FUEL_TYPE") %>'>
                        <asp:ListItem Value="">None</asp:ListItem>
                        <asp:ListItem Value="Electricity">Electricity</asp:ListItem>
                        <asp:ListItem Value="Gas">Gas</asp:ListItem>
                        <asp:ListItem Value="Dual">Both</asp:ListItem>
                    </asp:RadioButtonList>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# Bind("FUEL_TYPE") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Customer Contact Detail" SortExpression="TITLE">
                    <EditItemTemplate>

                    <table border="0">
                        <tr>
                            <th><input type="button" ID="btnAuth" runat="server" value="Same as Contact" onclick="btnAuthChanged()"/></th>
                            <th>Contact Detail</th>
                            <th>Authorised Signatory Detail</th>
                        </tr>
                        <tr>
                            <td>Title</td>
                            <td>
                                <asp:DropDownList ID="TITLE" runat="server" 
                                    SelectedValue='<%# Bind("TITLE") %>'>
                                        <asp:ListItem Value="">Select...</asp:ListItem>
                                        <asp:ListItem>MR</asp:ListItem>
                                        <asp:ListItem>MISS</asp:ListItem>
                                        <asp:ListItem>MRS</asp:ListItem>
                                        <asp:ListItem>MS</asp:ListItem>
                                        <asp:ListItem>DR</asp:ListItem>
                                        <asp:ListItem>PROF</asp:ListItem>
                                        <asp:ListItem>REVEREND</asp:ListItem>
                                        <asp:ListItem>SIR</asp:ListItem>
                                        <asp:ListItem>FATHER</asp:ListItem>
                                    </asp:DropDownList>
                            </td>
                            <td>
                                <asp:DropDownList ID="AUTH_TITLE" runat="server" 
                                    SelectedValue='<%# Bind("AUTH_TITLE") %>'>
                                        <asp:ListItem Value="">Select...</asp:ListItem>
                                        <asp:ListItem>MR</asp:ListItem>
                                        <asp:ListItem>MISS</asp:ListItem>
                                        <asp:ListItem>MRS</asp:ListItem>
                                        <asp:ListItem>MS</asp:ListItem>
                                        <asp:ListItem>DR</asp:ListItem>
                                        <asp:ListItem>PROF</asp:ListItem>
                                        <asp:ListItem>REVEREND</asp:ListItem>
                                        <asp:ListItem>SIR</asp:ListItem>
                                        <asp:ListItem>FATHER</asp:ListItem>
                                    </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td>First Name</td>
                            <td><asp:TextBox ID="FIRST_NAME" runat="server" Text='<%# Bind("FIRST_NAME") %>'></asp:TextBox></td>
                            <td><asp:TextBox ID="AUTH_FIRST_NAME" runat="server" Text='<%# Bind("AUTH_FIRST_NAME") %>'></asp:TextBox></td>
                        </tr>
                        <tr>
                            <td>Last Name</td>
                            <td><asp:TextBox ID="LAST_NAME" runat="server" Text='<%# Bind("LAST_NAME") %>'></asp:TextBox></td>
                            <td><asp:TextBox ID="AUTH_LAST_NAME" runat="server" Text='<%# Bind("AUTH_LAST_NAME") %>'></asp:TextBox></td>
                        </tr>
                        <tr>
                            <td>Position</td>
                            <td><asp:TextBox ID="POSITION" runat="server" Text='<%# Bind("POSITION") %>'></asp:TextBox></td>
                            <td><asp:TextBox ID="AUTH_POSITION" runat="server" Text='<%# Bind("AUTH_POSITION") %>'></asp:TextBox></td>
                        </tr>
                    </table>

                    </EditItemTemplate>
                    <InsertItemTemplate>
                    <table border="0">
                        <tr>
                            <th><input type="button" ID="btnAuth" runat="server" value="Same as Contact" onclick="btnAuthChanged()"/></th>
                            <th>Contact Detail</th>
                            <th>Authorised Signatory Detail</th>
                        </tr>
                        <tr>
                            <td>Title</td>
                            <td>
                                <asp:DropDownList ID="TITLE" runat="server" 
                                    SelectedValue='<%# Bind("TITLE") %>'>
                                        <asp:ListItem Value="">Select...</asp:ListItem>
                                        <asp:ListItem>MR</asp:ListItem>
                                        <asp:ListItem>MISS</asp:ListItem>
                                        <asp:ListItem>MRS</asp:ListItem>
                                        <asp:ListItem>MS</asp:ListItem>
                                        <asp:ListItem>DR</asp:ListItem>
                                        <asp:ListItem>PROF</asp:ListItem>
                                        <asp:ListItem>REVEREND</asp:ListItem>
                                        <asp:ListItem>SIR</asp:ListItem>
                                        <asp:ListItem>FATHER</asp:ListItem>
                                    </asp:DropDownList>
                            </td>
                            <td>
                                <asp:DropDownList ID="AUTH_TITLE" runat="server" 
                                    SelectedValue='<%# Bind("AUTH_TITLE") %>'>
                                        <asp:ListItem Value="">Select...</asp:ListItem>
                                        <asp:ListItem>MR</asp:ListItem>
                                        <asp:ListItem>MISS</asp:ListItem>
                                        <asp:ListItem>MRS</asp:ListItem>
                                        <asp:ListItem>MS</asp:ListItem>
                                        <asp:ListItem>DR</asp:ListItem>
                                        <asp:ListItem>PROF</asp:ListItem>
                                        <asp:ListItem>REVEREND</asp:ListItem>
                                        <asp:ListItem>SIR</asp:ListItem>
                                        <asp:ListItem>FATHER</asp:ListItem>
                                    </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td>First Name</td>
                            <td><asp:TextBox ID="FIRST_NAME" runat="server" Text='<%# Bind("FIRST_NAME") %>'></asp:TextBox></td>
                            <td><asp:TextBox ID="AUTH_FIRST_NAME" runat="server" Text='<%# Bind("AUTH_FIRST_NAME") %>'></asp:TextBox></td>
                        </tr>
                        <tr>
                            <td>Last Name</td>
                            <td><asp:TextBox ID="LAST_NAME" runat="server" Text='<%# Bind("LAST_NAME") %>'></asp:TextBox></td>
                            <td><asp:TextBox ID="AUTH_LAST_NAME" runat="server" Text='<%# Bind("AUTH_LAST_NAME") %>'></asp:TextBox></td>
                        </tr>
                        <tr>
                            <td>Position</td>
                            <td><asp:TextBox ID="POSITION" runat="server" Text='<%# Bind("POSITION") %>'></asp:TextBox></td>
                            <td><asp:TextBox ID="AUTH_POSITION" runat="server" Text='<%# Bind("AUTH_POSITION") %>'></asp:TextBox></td>
                        </tr>
                    </table>

                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label18" runat="server" Text='<%# Bind("TITLE") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>


                <asp:TemplateField HeaderText="Email" SortExpression="EMAIL">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox21" runat="server" Text='<%# Bind("EMAIL") %>' Width="300px"></asp:TextBox>
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:TextBox ID="TextBox22" runat="server" Text='<%# Bind("EMAIL") %>' Width="300px"></asp:TextBox>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label22" runat="server" Text='<%# Bind("EMAIL") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Business Phone e.g. (02)9999 8888" SortExpression="BPHONE">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox22" runat="server" Text='<%# Bind("BPHONE") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:TextBox ID="TextBox23" runat="server" Text='<%# Bind("BPHONE") %>'></asp:TextBox>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label23" runat="server" Text='<%# Bind("BPHONE") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Mobile Phone" SortExpression="MOBILE">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox23" runat="server" Text='<%# Bind("MOBILE") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:TextBox ID="TextBox24" runat="server" Text='<%# Bind("MOBILE") %>'></asp:TextBox>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label24" runat="server" Text='<%# Bind("MOBILE") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Fax e.g. (02)9999 8888" SortExpression="FAX">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox232" runat="server" Text='<%# Bind("FAX") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <InsertItemTemplate>
                        <asp:TextBox ID="TextBox242" runat="server" Text='<%# Bind("FAX") %>'></asp:TextBox>
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label242" runat="server" Text='<%# Bind("FAX") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>


                <asp:TemplateField HeaderText="Address" SortExpression="NOTICE_ADDRESS">
                    <EditItemTemplate>

                    <table border="0">
                        <tr>
                            <th><input type="button" ID="btnBill" runat="server" value="Same as Notices" onclick="btnBillChanged()"/></th>
                            <th>Notice Address</th>
                            <th>Bill Address</th>
                        </tr>
                        <tr>
                            <td><asp:Label ID="lblADDRESS" runat="server" Text="Address"></asp:Label></td>
                            <td><asp:TextBox ID="NOTICE_ADDRESS" runat="server" Text='<%# Bind("NOTICE_ADDRESS") %>'></asp:TextBox></td>
                            <td><asp:TextBox ID="BILL_ADDRESS" runat="server" Text='<%# Bind("BILL_ADDRESS") %>'></asp:TextBox></td>
                        </tr>
                        <tr>
                            <td><asp:Label ID="lblSUBURB" runat="server" Text="Suburb"></asp:Label></td>
                            <td><asp:TextBox ID="NOTICE_SUBURB" runat="server" Text='<%# Bind("NOTICE_SUBURB") %>'></asp:TextBox></td>
                            <td><asp:TextBox ID="BILL_SUBURB" runat="server" Text='<%# Bind("BILL_SUBURB") %>'></asp:TextBox></td>
                        </tr>
                        <tr>
                            <td><asp:Label ID="lblSTATE" runat="server" Text="State"></asp:Label></td>
                            <td>
                                <asp:DropDownList ID="SelNOTICE_STATE" runat="server"
                                SelectedValue='<%# Bind("NOTICE_STATE") %>'>
                                    <asp:ListItem Value="">Select...</asp:ListItem>
                                    <asp:ListItem>VIC</asp:ListItem>
                                    <asp:ListItem>NSW</asp:ListItem>
                                    <asp:ListItem>WA</asp:ListItem>
                                    <asp:ListItem>TAS</asp:ListItem>
                                    <asp:ListItem>NT</asp:ListItem>
                                    <asp:ListItem>SA</asp:ListItem>
                                    <asp:ListItem>QLD</asp:ListItem>
                                    <asp:ListItem>ACT</asp:ListItem>
                                </asp:DropDownList>
                            </td>
                            <td>
                                <asp:DropDownList ID="SelBILL_STATE" runat="server"
                                SelectedValue='<%# Bind("BILL_STATE") %>'>
                                    <asp:ListItem Value="">Select...</asp:ListItem>
                                    <asp:ListItem>VIC</asp:ListItem>
                                    <asp:ListItem>NSW</asp:ListItem>
                                    <asp:ListItem>WA</asp:ListItem>
                                    <asp:ListItem>TAS</asp:ListItem>
                                    <asp:ListItem>NT</asp:ListItem>
                                    <asp:ListItem>SA</asp:ListItem>
                                    <asp:ListItem>QLD</asp:ListItem>
                                    <asp:ListItem>ACT</asp:ListItem>
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td><asp:Label ID="lblPOSTCODE" runat="server" Text="Postcode"></asp:Label></td>
                            <td><asp:TextBox ID="NOTICE_POSTCODE" runat="server" Text='<%# Bind("NOTICE_POSTCODE") %>'></asp:TextBox></td>
                            <td><asp:TextBox ID="BILL_POSTCODE" runat="server" Text='<%# Bind("BILL_POSTCODE") %>'></asp:TextBox></td>
                        </tr>
                    </table>
                        
                    </EditItemTemplate>
                    <InsertItemTemplate>
                    <table border="0">
                        <tr>
                            <th><input type="button" ID="btnBill" runat="server" value="Same as Notices" onclick="btnBillChanged()"/></th>
                            <th>Notice Address</th>
                            <th>Bill Address</th>
                        </tr>
                        <tr>
                            <td><asp:Label ID="lblADDRESS" runat="server" Text="Address"></asp:Label></td>
                            <td><asp:TextBox ID="NOTICE_ADDRESS" runat="server" Text='<%# Bind("NOTICE_ADDRESS") %>'></asp:TextBox></td>
                            <td><asp:TextBox ID="BILL_ADDRESS" runat="server" Text='<%# Bind("BILL_ADDRESS") %>'></asp:TextBox></td>
                        </tr>
                        <tr>
                            <td><asp:Label ID="lblSUBURB" runat="server" Text="Suburb"></asp:Label></td>
                            <td><asp:TextBox ID="NOTICE_SUBURB" runat="server" Text='<%# Bind("NOTICE_SUBURB") %>'></asp:TextBox></td>
                            <td><asp:TextBox ID="BILL_SUBURB" runat="server" Text='<%# Bind("BILL_SUBURB") %>'></asp:TextBox></td>
                        </tr>
                        <tr>
                            <td><asp:Label ID="lblSTATE" runat="server" Text="State"></asp:Label></td>
                            <td>
                                <asp:DropDownList ID="SelNOTICE_STATE" runat="server"
                                SelectedValue='<%# Bind("NOTICE_STATE") %>'>
                                    <asp:ListItem Value="">Select...</asp:ListItem>
                                    <asp:ListItem>VIC</asp:ListItem>
                                    <asp:ListItem>NSW</asp:ListItem>
                                    <asp:ListItem>WA</asp:ListItem>
                                    <asp:ListItem>TAS</asp:ListItem>
                                    <asp:ListItem>NT</asp:ListItem>
                                    <asp:ListItem>SA</asp:ListItem>
                                    <asp:ListItem>QLD</asp:ListItem>
                                    <asp:ListItem>ACT</asp:ListItem>
                                </asp:DropDownList>
                            </td>
                            <td>
                                <asp:DropDownList ID="SelBILL_STATE" runat="server"
                                SelectedValue='<%# Bind("BILL_STATE") %>'>
                                    <asp:ListItem Value="">Select...</asp:ListItem>
                                    <asp:ListItem>VIC</asp:ListItem>
                                    <asp:ListItem>NSW</asp:ListItem>
                                    <asp:ListItem>WA</asp:ListItem>
                                    <asp:ListItem>TAS</asp:ListItem>
                                    <asp:ListItem>NT</asp:ListItem>
                                    <asp:ListItem>SA</asp:ListItem>
                                    <asp:ListItem>QLD</asp:ListItem>
                                    <asp:ListItem>ACT</asp:ListItem>
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td><asp:Label ID="lblPOSTCODE" runat="server" Text="Postcode"></asp:Label></td>
                            <td><asp:TextBox ID="NOTICE_POSTCODE" runat="server" Text='<%# Bind("NOTICE_POSTCODE") %>'></asp:TextBox></td>
                            <td><asp:TextBox ID="BILL_POSTCODE" runat="server" Text='<%# Bind("BILL_POSTCODE") %>'></asp:TextBox></td>
                        </tr>
                    </table>
                        
                    </InsertItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label16" runat="server" Text='<%# Bind("NOTICE_ADDRESS") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:CommandField ShowEditButton="True" />
                
            </Fields>

<PagerStyle CssClass="pgr"></PagerStyle>
        </asp:DetailsView>
        <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
            ConnectionString="<%$ ConnectionStrings:SQLServer2005DBConnectionString %>" 
            OldValuesParameterFormatString="original_{0}" 
            OnUpdated="SqlDataSource2_Updated"
            SelectCommand="SELECT [USERID], [DATE_CONV], [ELEC_STAT], [REGI_DATE], [GAS_STAT], [OPERATOR], [COMMENT], [PREF_DAY], [PREF_TIME], [PROM_CODE], [LEAD_CODE], [ADMIN_FEE], [VENDOR_ID], [COMPANY_NAME], [FAX], [TITLE], [FIRST_NAME], [LAST_NAME], [POSITION], [EMAIL], [BPHONE], [MOBILE], [AUTH_TITLE], [AUTH_FIRST_NAME], [AUTH_LAST_NAME], [AUTH_POSITION], [NOTICE_ADDRESS], [NOTICE_SUBURB], [NOTICE_STATE], [NOTICE_POSTCODE], [BILL_ADDRESS], [BILL_SUBURB], [BILL_STATE], [BILL_POSTCODE], [BUSINESS_TYPE], [FUEL_TYPE], [STTS_WINNER_ELEC], [STTS_TERM_ELEC], [STTS_START_ELEC], [STTS_END_ELEC], [STTS_WINNER_GAS], [STTS_TERM_GAS], [STTS_START_GAS], [STTS_END_GAS] FROM [tblCI] WHERE ([USERID] = @USERID)" 
            DeleteCommand="DELETE FROM [tblCI] WHERE [USERID] = @original_USERID" 
            InsertCommand="INSERT INTO [tblCI] ([DATE_CONV], [ELEC_STAT], [GAS_STAT], [OPERATOR], [COMMENT], [PREF_DAY], [PREF_TIME], [PROM_CODE], [LEAD_CODE], [ADMIN_FEE], [VENDOR_ID], [COMPANY_NAME], [FAX], [TITLE], [FIRST_NAME], [LAST_NAME], [POSITION], [EMAIL], [BPHONE], [MOBILE], [AUTH_TITLE], [AUTH_FIRST_NAME], [AUTH_LAST_NAME], [AUTH_POSITION], [NOTICE_ADDRESS], [NOTICE_SUBURB], [NOTICE_STATE], [NOTICE_POSTCODE], [BILL_ADDRESS], [BILL_SUBURB], [BILL_STATE], [BILL_POSTCODE], [BUSINESS_TYPE], [FUEL_TYPE], [STTS_WINNER_ELEC], [STTS_TERM_ELEC], [STTS_START_ELEC], [STTS_END_ELEC], [STTS_WINNER_GAS], [STTS_TERM_GAS], [STTS_START_GAS], [STTS_END_GAS]) VALUES (@DATE_CONV, @ELEC_STAT, @GAS_STAT, @OPERATOR, @COMMENT, @PREF_DAY, @PREF_TIME, @PROM_CODE, @LEAD_CODE, @ADMIN_FEE, @VENDOR_ID, @COMPANY_NAME, @FAX, @TITLE, @FIRST_NAME, @LAST_NAME, @POSITION, @EMAIL, @BPHONE, @MOBILE, @AUTH_TITLE, @AUTH_FIRST_NAME, @AUTH_LAST_NAME, @AUTH_POSITION, @NOTICE_ADDRESS, @NOTICE_SUBURB, @NOTICE_STATE, @NOTICE_POSTCODE, @BILL_ADDRESS, @BILL_SUBURB, @BILL_STATE, @BILL_POSTCODE, @BUSINESS_TYPE, @FUEL_TYPE, @STTS_WINNER_ELEC, @STTS_TERM_ELEC, @STTS_START_ELEC, @STTS_END_ELEC, @STTS_WINNER_GAS, @STTS_TERM_GAS, @STTS_START_GAS, @STTS_END_GAS)" 

            
            
            UpdateCommand="UPDATE [tblCI] SET [DATE_CONV] = @DATE_CONV, [ELEC_STAT] = @ELEC_STAT, [GAS_STAT] = @GAS_STAT, [OPERATOR] = @OPERATOR, [COMMENT] = @COMMENT, [PREF_DAY] = @PREF_DAY, [PREF_TIME] = @PREF_TIME, [PROM_CODE] = @PROM_CODE, [LEAD_CODE] = @LEAD_CODE, [ADMIN_FEE] = @ADMIN_FEE, [VENDOR_ID] = @VENDOR_ID, [COMPANY_NAME] = @COMPANY_NAME, [FAX] = @FAX, [TITLE] = @TITLE, [FIRST_NAME] = @FIRST_NAME, [LAST_NAME] = @LAST_NAME, [POSITION] = @POSITION, [EMAIL] = @EMAIL, [BPHONE] = @BPHONE, [MOBILE] = @MOBILE, [AUTH_TITLE] = @AUTH_TITLE, [AUTH_FIRST_NAME] = @AUTH_FIRST_NAME, [AUTH_LAST_NAME] = @AUTH_LAST_NAME, [AUTH_POSITION] = @AUTH_POSITION, [NOTICE_ADDRESS] = @NOTICE_ADDRESS, [NOTICE_SUBURB] = @NOTICE_SUBURB, [NOTICE_STATE] = @NOTICE_STATE, [NOTICE_POSTCODE] = @NOTICE_POSTCODE, [BILL_ADDRESS] = @BILL_ADDRESS, [BILL_SUBURB] = @BILL_SUBURB, [BILL_STATE] = @BILL_STATE, [BILL_POSTCODE] = @BILL_POSTCODE, [BUSINESS_TYPE] = @BUSINESS_TYPE, [FUEL_TYPE] = @FUEL_TYPE, [STTS_WINNER_ELEC] = @STTS_WINNER_ELEC, [STTS_TERM_ELEC] = @STTS_TERM_ELEC, [STTS_START_ELEC] = @STTS_START_ELEC, [STTS_END_ELEC] = @STTS_END_ELEC, [STTS_WINNER_GAS] = @STTS_WINNER_GAS, [STTS_TERM_GAS] = @STTS_TERM_GAS, [STTS_START_GAS] = @STTS_START_GAS, [STTS_END_GAS] = @STTS_END_GAS WHERE [USERID] = @original_USERID">
            <DeleteParameters>
                <asp:Parameter Name="original_USERID" Type="Int32" />
            </DeleteParameters>
            <InsertParameters>
                <asp:Parameter Name="DATE_CONV" Type="String" />
                <asp:Parameter Name="ELEC_STAT" Type="String" />
                <asp:Parameter Name="GAS_STAT" Type="String" />
                <asp:Parameter Name="OPERATOR" Type="String" />
                <asp:Parameter Name="COMMENT" Type="String" />
                <asp:Parameter Name="PREF_DAY" Type="String" />
                <asp:Parameter Name="PREF_TIME" Type="String" />
                <asp:Parameter Name="PROM_CODE" Type="String" />
                <asp:Parameter Name="LEAD_CODE" Type="String" />
                <asp:Parameter Name="ADMIN_FEE" Type="String" />
                <asp:Parameter Name="VENDOR_ID" Type="String" />
                <asp:Parameter Name="COMPANY_NAME" Type="String" />
                <asp:Parameter Name="FAX" Type="String" />
                <asp:Parameter Name="TITLE" Type="String" />
                <asp:Parameter Name="FIRST_NAME" Type="String" />
                <asp:Parameter Name="LAST_NAME" Type="String" />
                <asp:Parameter Name="POSITION" Type="String" />
                <asp:Parameter Name="EMAIL" Type="String" />
                <asp:Parameter Name="BPHONE" Type="String" />
                <asp:Parameter Name="MOBILE" Type="String" />
                <asp:Parameter Name="AUTH_TITLE" Type="String" />
                <asp:Parameter Name="AUTH_FIRST_NAME" Type="String" />
                <asp:Parameter Name="AUTH_LAST_NAME" Type="String" />
                <asp:Parameter Name="AUTH_POSITION" Type="String" />
                <asp:Parameter Name="NOTICE_ADDRESS" Type="String" />
                <asp:Parameter Name="NOTICE_SUBURB" Type="String" />
                <asp:Parameter Name="NOTICE_STATE" Type="String" />
                <asp:Parameter Name="NOTICE_POSTCODE" Type="String" />
                <asp:Parameter Name="BILL_ADDRESS" Type="String" />
                <asp:Parameter Name="BILL_SUBURB" Type="String" />
                <asp:Parameter Name="BILL_STATE" Type="String" />
                <asp:Parameter Name="BILL_POSTCODE" Type="String" />
                <asp:Parameter Name="BUSINESS_TYPE" Type="String" />
                <asp:Parameter Name="FUEL_TYPE" Type="String" />
                <asp:Parameter Name="STTS_WINNER_ELEC" Type="String" />
                <asp:Parameter Name="STTS_TERM_ELEC" Type="String" />
                <asp:Parameter Name="STTS_START_ELEC" Type="String" />
                <asp:Parameter Name="STTS_END_ELEC" Type="String" />
                <asp:Parameter Name="STTS_WINNER_GAS" Type="String" />
                <asp:Parameter Name="STTS_TERM_GAS" Type="String" />
                <asp:Parameter Name="STTS_START_GAS" Type="String" />
                <asp:Parameter Name="STTS_END_GAS" Type="String" />
            </InsertParameters>
            <SelectParameters>
                <asp:ControlParameter ControlID="GridView1" Name="USERID" 
                    PropertyName="SelectedValue" Type="Int32" />
            </SelectParameters>
            <UpdateParameters>
                <asp:Parameter Name="DATE_CONV" Type="String" />
                <asp:Parameter Name="ELEC_STAT" Type="String" />
                <asp:Parameter Name="GAS_STAT" Type="String" />
                <asp:Parameter Name="OPERATOR" Type="String" />
                <asp:Parameter Name="COMMENT" Type="String" />
                <asp:Parameter Name="PREF_DAY" Type="String" />
                <asp:Parameter Name="PREF_TIME" Type="String" />
                <asp:Parameter Name="PROM_CODE" Type="String" />
                <asp:Parameter Name="LEAD_CODE" Type="String" />
                <asp:Parameter Name="ADMIN_FEE" Type="String" />
                <asp:Parameter Name="VENDOR_ID" Type="String" />
                <asp:Parameter Name="COMPANY_NAME" Type="String" />
                <asp:Parameter Name="FAX" Type="String" />
                <asp:Parameter Name="TITLE" Type="String" />
                <asp:Parameter Name="FIRST_NAME" Type="String" />
                <asp:Parameter Name="LAST_NAME" Type="String" />
                <asp:Parameter Name="POSITION" Type="String" />
                <asp:Parameter Name="EMAIL" Type="String" />
                <asp:Parameter Name="BPHONE" Type="String" />
                <asp:Parameter Name="MOBILE" Type="String" />
                <asp:Parameter Name="AUTH_TITLE" Type="String" />
                <asp:Parameter Name="AUTH_FIRST_NAME" Type="String" />
                <asp:Parameter Name="AUTH_LAST_NAME" Type="String" />
                <asp:Parameter Name="AUTH_POSITION" Type="String" />
                <asp:Parameter Name="NOTICE_ADDRESS" Type="String" />
                <asp:Parameter Name="NOTICE_SUBURB" Type="String" />
                <asp:Parameter Name="NOTICE_STATE" Type="String" />
                <asp:Parameter Name="NOTICE_POSTCODE" Type="String" />
                <asp:Parameter Name="BILL_ADDRESS" Type="String" />
                <asp:Parameter Name="BILL_SUBURB" Type="String" />
                <asp:Parameter Name="BILL_STATE" Type="String" />
                <asp:Parameter Name="BILL_POSTCODE" Type="String" />
                <asp:Parameter Name="BUSINESS_TYPE" Type="String" />
                <asp:Parameter Name="FUEL_TYPE" Type="String" />
                <asp:Parameter Name="STTS_WINNER_ELEC" Type="String" />
                <asp:Parameter Name="STTS_TERM_ELEC" Type="String" />
                <asp:Parameter Name="STTS_START_ELEC" Type="String" />
                <asp:Parameter Name="STTS_END_ELEC" Type="String" />
                <asp:Parameter Name="STTS_WINNER_GAS" Type="String" />
                <asp:Parameter Name="STTS_TERM_GAS" Type="String" />
                <asp:Parameter Name="STTS_START_GAS" Type="String" />
                <asp:Parameter Name="STTS_END_GAS" Type="String" />
                <asp:Parameter Name="original_USERID" Type="Int32" />
            </UpdateParameters>
        </asp:SqlDataSource>

        <hr />

        <asp:SqlDataSource ID="SqlDataSource9" runat="server" 
            ConnectionString="<%$ ConnectionStrings:SQLServer2005DBConnectionString %>" 
            
            SelectCommand="SELECT DISTINCT [CurrentProviderName], [CurrentProviderID] FROM [tblCurrentProvider] ORDER BY [CurrentProviderID]"></asp:SqlDataSource>


        <asp:MultiView ID="MultiView1" runat="server" ActiveViewIndex="0">

            <asp:View ID="View1" runat="server">
            </asp:View>
            <asp:View ID="View2" runat="server">
            <h1>Electricity Form</h1>
                

                    <asp:DetailsView ID="DetailsView2" runat="Server" CellPadding="4" ForeColor="#333333"
                        GridLines="None" DataSourceID="SqlDataSource3" AllowPaging="True" AutoGenerateRows="False"
                        DataKeyNames="USERID" DefaultMode="Edit" CssClass="mGrid" FieldHeaderStyle-Font-Bold="true" 
                        Font-Names="Times New Roman" CommandRowStyle-Font-Size="13" CommandRowStyle-ForeColor="red"
                        PagerStyle-CssClass="pgr" AlternatingRowStyle-CssClass="alt" 
                        OnItemUpdated="DetailsView2_ItemUpdated"
                            EnableModelValidation="True">
                        <AlternatingRowStyle CssClass="alt"></AlternatingRowStyle>
                        <CommandRowStyle Font-Size="13pt" />
                        <FieldHeaderStyle Font-Bold="True" />
                        <Fields>
                            <asp:BoundField DataField="USERID" HeaderText="USERID" InsertVisible="False" 
                                ReadOnly="True" SortExpression="USERID" />
                            <asp:TemplateField HeaderText="Current Electricity Retailer" 
                                SortExpression="Current Electricity Retailer">
                                <EditItemTemplate>


                                    <asp:TextBox ID="ELEC_CURRENT_RETAILER" runat="server" Text='<%# Bind("ELEC_CURRENT_RETAILER") %>'></asp:TextBox>
       
                                    <asp:DropDownList name="SelELEC_CURRENT_RETAILER" ID="SelELEC_CURRENT_RETAILER" runat="Server" onchange="SelELEC_CURRENT_RETAILERChanged()"
                                                 DataSourceID="SqlDataSource9" DataTextField="CurrentProviderName" DataValueField="CurrentProviderName" />


                                    
                                </EditItemTemplate>
                                <InsertItemTemplate>
                                    <asp:TextBox ID="TextBox1" runat="server" 
                                        Text='<%# Bind("ELEC_CURRENT_RETAILER") %>'></asp:TextBox>
                                </InsertItemTemplate>
                                <ItemTemplate>
                                    <asp:Label ID="Label1" runat="server" 
                                        Text='<%# Bind("ELEC_CURRENT_RETAILER") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Price Type requested" 
                                SortExpression="ELEC_PRICE_TYPE">
                                <EditItemTemplate>
                                    <asp:DropDownList ID="SelELEC_PRICE_TYPE" runat="server" 
                                        SelectedValue='<%# Bind("ELEC_PRICE_TYPE") %>'  AppendDataBoundItems="true" OnDataBound="Sel_Bound">
                                        <asp:ListItem Text="--Select One--" Value="" />
                                        <asp:ListItem Value="Firm">Firm</asp:ListItem>
                                        <asp:ListItem>Indicative</asp:ListItem>
                                    </asp:DropDownList>
                                </EditItemTemplate>
                                <InsertItemTemplate>
                                    <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("ELEC_PRICE_TYPE") %>'></asp:TextBox>
                                </InsertItemTemplate>
                                <ItemTemplate>
                                    <asp:Label ID="Label2" runat="server" Text='<%# Bind("ELEC_PRICE_TYPE") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Carbon Pricing options" 
                                SortExpression="ELEC_CARBON_PRICE_OPTION">
                                <EditItemTemplate>
                                    <asp:DropDownList ID="SelELEC_CARBON_PRICE_OPTION" runat="server" 
                                        SelectedValue='<%# Bind("ELEC_CARBON_PRICE_OPTION") %>' OnDataBound="Sel_Bound">
                                        <asp:ListItem Text="--Select One--" Value="" />
                                        <asp:ListItem>Inclusive and Exclusive</asp:ListItem>
                                        <asp:ListItem>Inclusive</asp:ListItem>
                                        <asp:ListItem>Exclusive</asp:ListItem>
                                    </asp:DropDownList>
                                </EditItemTemplate>
                                <InsertItemTemplate>
                                    <asp:TextBox ID="TextBox3" runat="server" 
                                        Text='<%# Bind("ELEC_CARBON_PRICE_OPTION") %>'></asp:TextBox>
                                </InsertItemTemplate>
                                <ItemTemplate>
                                    <asp:Label ID="Label3" runat="server" 
                                        Text='<%# Bind("ELEC_CARBON_PRICE_OPTION") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Green Energy Requirement" 
                                SortExpression="ELEC_GREEN_ENERGY_REQUIREMENT">
                                <EditItemTemplate>
                                    <asp:DropDownList ID="SelELEC_GREEN_ENERGY_REQUIREMENT" runat="server" 
                                        onchange="ELEC_GREEN_ENERGY_REQUIREMENTChanged()" 
                                        SelectedValue='<%# Bind("ELEC_GREEN_ENERGY_REQUIREMENT") %>'  OnDataBound="Sel_Bound">
                                        <asp:ListItem Text="--Select One--" Value="" />
                                        <asp:ListItem>No</asp:ListItem>
                                        <asp:ListItem>Yes</asp:ListItem>
                                        
                                    </asp:DropDownList>
                                    <asp:Label ID="lblELEC_GREEN_ENERGY_PERCENT" runat="server" 
                                        Text="Green Energy(%)"></asp:Label>
                                    <asp:TextBox ID="ELEC_GREEN_ENERGY_PERCENT" runat="server" 
                                        Text='<%# Bind("ELEC_GREEN_ENERGY_PERCENT") %>' size="2px"></asp:TextBox>
                                </EditItemTemplate>
                                <InsertItemTemplate>
                                    <asp:DropDownList ID="SelELEC_GREEN_ENERGY_REQUIREMENT" runat="server" 
                                        onchange="ELEC_GREEN_ENERGY_REQUIREMENTChanged()" 
                                        SelectedValue='<%# Bind("ELEC_GREEN_ENERGY_REQUIREMENT") %>'  OnDataBound="Sel_Bound">
                                        <asp:ListItem Text="--Select One--" Value="" />
                                        <asp:ListItem>No</asp:ListItem>
                                        <asp:ListItem>Yes</asp:ListItem>
                                    </asp:DropDownList>
                                    <asp:Label ID="lblELEC_GREEN_ENERGY_PERCENT" runat="server" 
                                        Text="Green Energy Percentage"></asp:Label>
                                    <asp:TextBox ID="ELEC_GREEN_ENERGY_PERCENT" runat="server" 
                                        Text='<%# Bind("ELEC_GREEN_ENERGY_PERCENT") %>'></asp:TextBox>
                                </InsertItemTemplate>
                                <ItemTemplate>
                                    <asp:Label ID="Label4" runat="server" 
                                        Text='<%# Bind("ELEC_GREEN_ENERGY_REQUIREMENT") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Contract Start Date" 
                                SortExpression="ELEC_CONTRACT_START_DATE">
                                <EditItemTemplate>
                                    <asp:TextBox ID="ELEC_CONTRACT_START_DATE" runat="server" onclick="WdatePicker()" 
                                        Text='<%# Bind("ELEC_CONTRACT_START_DATE") %>' onchange="SelELEC_CONTRACT_TERMChanged()"></asp:TextBox>
                                </EditItemTemplate>
                                <InsertItemTemplate>
                                    <asp:TextBox ID="TextBox6" runat="server" 
                                        Text='<%# Bind("ELEC_CONTRACT_START_DATE") %>'></asp:TextBox>
                                </InsertItemTemplate>
                                <ItemTemplate>
                                    <asp:Label ID="Label6" runat="server" 
                                        Text='<%# Bind("ELEC_CONTRACT_START_DATE") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Contract Term" 
                                SortExpression="ELEC_CONTRACT_TERM">
                                <EditItemTemplate>
                                    <asp:DropDownList ID="SelELEC_CONTRACT_TERM" runat="server" 
                                        SelectedValue='<%# Bind("ELEC_CONTRACT_TERM") %>' onchange="SelELEC_CONTRACT_TERMChanged()">
                                        <asp:ListItem Value="">Select...</asp:ListItem>
                                        <asp:ListItem>1</asp:ListItem>
                                        <asp:ListItem>2</asp:ListItem>
                                        <asp:ListItem>3</asp:ListItem>
                                        <asp:ListItem>4</asp:ListItem>
                                        <asp:ListItem>5</asp:ListItem>
                                        <asp:ListItem>6</asp:ListItem>
                                    </asp:DropDownList>
                                    <asp:Label ID="lblELEC_CONTRACT_TERM" runat="server" Text="Year"></asp:Label>
                                </EditItemTemplate>
                                <InsertItemTemplate>
                                    <asp:TextBox ID="TextBox7" runat="server" 
                                        Text='<%# Bind("ELEC_CONTRACT_TERM") %>'></asp:TextBox>
                                </InsertItemTemplate>
                                <ItemTemplate>
                                    <asp:Label ID="Label7" runat="server" Text='<%# Bind("ELEC_CONTRACT_TERM") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Individual Year Option?" 
                                SortExpression="ELEC_INDIVIDUAL_YEAR_OPTION">
                                <EditItemTemplate>
                                    <asp:DropDownList ID="SelELEC_INDIVIDUAL_YEAR_OPTION" runat="server" 
                                        SelectedValue='<%# Bind("ELEC_INDIVIDUAL_YEAR_OPTION") %>'   OnDataBound="Sel_Bound">
                                        <asp:ListItem Text="--Select One--" Value="" />
                                        <asp:ListItem>No</asp:ListItem>
                                        <asp:ListItem>Yes</asp:ListItem>
                                        
                                    </asp:DropDownList>
                                </EditItemTemplate>
                                <InsertItemTemplate>
                                    <asp:TextBox ID="TextBox8" runat="server" 
                                        Text='<%# Bind("ELEC_INDIVIDUAL_YEAR_OPTION") %>'></asp:TextBox>
                                </InsertItemTemplate>
                                <ItemTemplate>
                                    <asp:Label ID="Label8" runat="server" 
                                        Text='<%# Bind("ELEC_INDIVIDUAL_YEAR_OPTION") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Contract End date" 
                                SortExpression="ELEC_CONTRACT_END_DATE">
                                <EditItemTemplate>
                                    <asp:TextBox ID="ELEC_CONTRACT_END_DATE" runat="server" onclick="WdatePicker()" 
                                        Text='<%# Bind("ELEC_CONTRACT_END_DATE") %>'></asp:TextBox>
                                </EditItemTemplate>
                                <InsertItemTemplate>
                                    <asp:TextBox ID="TextBox9" runat="server" 
                                        Text='<%# Bind("ELEC_CONTRACT_END_DATE") %>'></asp:TextBox>
                                </InsertItemTemplate>
                                <ItemTemplate>
                                    <asp:Label ID="Label9" runat="server" 
                                        Text='<%# Bind("ELEC_CONTRACT_END_DATE") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Alternative End Date" 
                                SortExpression="ELEC_ALTER_END_DATE">
                                <EditItemTemplate>
                                    <asp:TextBox ID="ELEC_ALTER_END_DATE" runat="server" onclick="WdatePicker()" 
                                        Text='<%# Bind("ELEC_ALTER_END_DATE") %>' onchange="ELEC_ALTER_END_DATEChanged()"></asp:TextBox>
                                </EditItemTemplate>
                                <InsertItemTemplate>
                                    <asp:TextBox ID="TextBox10" runat="server" 
                                        Text='<%# Bind("ELEC_ALTER_END_DATE") %>'></asp:TextBox>
                                </InsertItemTemplate>
                                <ItemTemplate>
                                    <asp:Label ID="Label10" runat="server" 
                                        Text='<%# Bind("ELEC_ALTER_END_DATE") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Price required by COB" 
                                SortExpression="ELEC_PRICE_COB">
                                <EditItemTemplate>
                                    <asp:TextBox ID="TextBox11" runat="server" onclick="WdatePicker()" 
                                        Text='<%# Bind("ELEC_PRICE_COB") %>'></asp:TextBox>
                                </EditItemTemplate>
                                <InsertItemTemplate>
                                    <asp:TextBox ID="TextBox11" runat="server" Text='<%# Bind("ELEC_PRICE_COB") %>'></asp:TextBox>
                                </InsertItemTemplate>
                                <ItemTemplate>
                                    <asp:Label ID="Label11" runat="server" Text='<%# Bind("ELEC_PRICE_COB") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Data Provided by Customer" 
                                SortExpression="ELEC_DATA_PROVIDED">
                                <EditItemTemplate>
                                    <asp:DropDownList ID="SelELEC_DATA_PROVIDED" runat="server" 
                                        SelectedValue='<%# Bind("ELEC_DATA_PROVIDED") %>'>
                                        <asp:ListItem Value="">Select...</asp:ListItem>
                                        <asp:ListItem>Interval meter data</asp:ListItem>
                                        <asp:ListItem>Bill copy or papersummary</asp:ListItem>
                                        <asp:ListItem>no data provided</asp:ListItem>
                                    </asp:DropDownList>
                                </EditItemTemplate>
                                <InsertItemTemplate>
                                    <asp:TextBox ID="TextBox12" runat="server" 
                                        Text='<%# Bind("ELEC_DATA_PROVIDED") %>'></asp:TextBox>
                                </InsertItemTemplate>
                                <ItemTemplate>
                                    <asp:Label ID="Label12" runat="server" Text='<%# Bind("ELEC_DATA_PROVIDED") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Electricity Site Details">
                                <EditItemTemplate>
                                    <asp:SqlDataSource ID="SqlDataSource5" runat="server" 
                                        ConnectionString="<%$ ConnectionStrings:SQLServer2005DBConnectionString %>" 
                                        DeleteCommand="DELETE FROM [tblCI_ELEC_SITE_DETAIL] WHERE [ID] = @ID" 
                                        InsertCommand="INSERT INTO [tblCI_ELEC_SITE_DETAIL] ([USERID], [SITE_NO], [COMPANY_NAME], [ABN], [ACN], [NMI], [ACCOUNT_NO], [SITE_NAME], [SITE_ADDRESS], [SITE_SUBURB], [SITE_STATE], [SITE_POSTCODE], [PA_PK], [PA_SH], [PA_OP], [PA_TOTAL], [START_DATE], [END_DATE], [GREEN_ENERGY_PERCENT], [COMMENT], [PA_SPEND]) VALUES (@USERID, @SITE_NO, @COMPANY_NAME, @ABN, @ACN, @NMI, @ACCOUNT_NO, @SITE_NAME, @SITE_ADDRESS, @SITE_SUBURB, @SITE_STATE, @SITE_POSTCODE, @PA_PK, @PA_SH, @PA_OP, @PA_TOTAL, @START_DATE, @END_DATE, @GREEN_ENERGY_PERCENT, @COMMENT, @PA_SPEND)" 
                                        SelectCommand="SELECT * FROM [tblCI_ELEC_SITE_DETAIL] WHERE ([USERID] = @USERID)" 
                                        
                                        UpdateCommand="UPDATE [tblCI_ELEC_SITE_DETAIL] SET  [SITE_NO] = @SITE_NO, [COMPANY_NAME] = @COMPANY_NAME, [ABN] = @ABN, [ACN] = @ACN, [NMI] = @NMI, [ACCOUNT_NO] = @ACCOUNT_NO, [SITE_NAME] = @SITE_NAME, [SITE_ADDRESS] = @SITE_ADDRESS, [SITE_SUBURB] = @SITE_SUBURB, [SITE_STATE] = @SITE_STATE, [SITE_POSTCODE] = @SITE_POSTCODE, [PA_PK] = @PA_PK, [PA_SH] = @PA_SH, [PA_OP] = @PA_OP, [PA_TOTAL] = @PA_TOTAL, [START_DATE] = @START_DATE, [END_DATE] = @END_DATE, [GREEN_ENERGY_PERCENT] = @GREEN_ENERGY_PERCENT, [COMMENT] = @COMMENT, [PA_SPEND] = @PA_SPEND WHERE [ID] = @ID">
                                        <DeleteParameters>
                                            <asp:Parameter Name="ID" Type="Int32" />
                                        </DeleteParameters>
                                        <InsertParameters>
                                            
                                            
                                            <asp:Parameter Name="SITE_NO" Type="Int32" />
                                            <asp:Parameter Name="COMPANY_NAME" Type="String" />
                                            <asp:Parameter Name="ABN" Type="String" />
                                            <asp:Parameter Name="ACN" Type="String" />
                                            <asp:Parameter Name="NMI" Type="String" />
                                            <asp:Parameter Name="ACCOUNT_NO" Type="String" />
                                            <asp:Parameter Name="SITE_NAME" Type="String" />
                                            <asp:Parameter Name="SITE_ADDRESS" Type="String" />
                                            <asp:Parameter Name="SITE_SUBURB" Type="String" />
                                            <asp:Parameter Name="SITE_STATE" Type="String" />
                                            <asp:Parameter Name="SITE_POSTCODE" Type="String" />
                                            <asp:Parameter Name="PA_PK" Type="String" />
                                            <asp:Parameter Name="PA_SH" Type="String" />
                                            <asp:Parameter Name="PA_OP" Type="String" />
                                            <asp:Parameter Name="PA_TOTAL" Type="String" />
                                            <asp:Parameter Name="START_DATE" Type="String" />
                                            <asp:Parameter Name="END_DATE" Type="String" />
                                            <asp:Parameter Name="GREEN_ENERGY_PERCENT" Type="String" />
                                            <asp:Parameter Name="COMMENT" Type="String" />
                                            <asp:Parameter Name="PA_SPEND" Type="Int32" />
                                        </InsertParameters>
                                        <SelectParameters>
                                            <asp:ControlParameter ControlID="GridView1" Name="USERID" 
                                                PropertyName="SelectedValue" Type="Int32" />
                                        </SelectParameters>
                                        <UpdateParameters>
                                            
                                           
                                            <asp:Parameter Name="SITE_NO" Type="Int32" />
                                            <asp:Parameter Name="COMPANY_NAME" Type="String" />
                                            <asp:Parameter Name="ABN" Type="String" />
                                            <asp:Parameter Name="ACN" Type="String" />
                                            <asp:Parameter Name="NMI" Type="String" />
                                            <asp:Parameter Name="ACCOUNT_NO" Type="String" />
                                            <asp:Parameter Name="SITE_NAME" Type="String" />
                                            <asp:Parameter Name="SITE_ADDRESS" Type="String" />
                                            <asp:Parameter Name="SITE_SUBURB" Type="String" />
                                            <asp:Parameter Name="SITE_STATE" Type="String" />
                                            <asp:Parameter Name="SITE_POSTCODE" Type="String" />
                                            <asp:Parameter Name="PA_PK" Type="String" />
                                            <asp:Parameter Name="PA_SH" Type="String" />
                                            <asp:Parameter Name="PA_OP" Type="String" />
                                            <asp:Parameter Name="PA_TOTAL" Type="String" />
                                            <asp:Parameter Name="START_DATE" Type="String" />
                                            <asp:Parameter Name="END_DATE" Type="String" />
                                            <asp:Parameter Name="GREEN_ENERGY_PERCENT" Type="String" />
                                            <asp:Parameter Name="COMMENT" Type="String" />
                                            <asp:Parameter Name="PA_SPEND" Type="Int32" />
                                            <asp:Parameter Name="ID" Type="Int32" />
                                        </UpdateParameters>
                                    </asp:SqlDataSource>
                                    <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" 
                                        DataKeyNames="ID" DataSourceID="SqlDataSource5" EnableModelValidation="True">
                                        <Columns>
                                            <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
                                            <asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False" 
                                                ReadOnly="True" SortExpression="ID"  Visible="false"/>


                                            <asp:TemplateField HeaderText="USERID" SortExpression="USERID" Visible="false">
                                                <EditItemTemplate>
                                                    <asp:Label ID="USERID" runat="server" Text='<%# Bind("USERID") %>'></asp:Label>
                                                </EditItemTemplate>
                                                <ItemTemplate>
                                                    <asp:Label ID="USERID" runat="server" Text='<%# Bind("USERID") %>'></asp:Label>
                                                </ItemTemplate>
                                            </asp:TemplateField>


                                            <asp:TemplateField HeaderText="Site Info" SortExpression="SITE_NO">
                                                <EditItemTemplate>

                                                    <table border="0">
                                                        <tr>
                                                            <td>Site Number</td>
                                                            <td><asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("SITE_NO") %>' Width="20px"></asp:TextBox></td>
                                                        </tr>
                                                        <tr>
                                                            <td>Company Name
                                                            
                                                            </td>
                                                            <td><asp:TextBox ID="COMPANY_NAME" runat="server" Text='<%# Bind("COMPANY_NAME") %>' Width="250px"></asp:TextBox>
                                                           <br/><input type="button" ID="Copy_CN" runat="server" value="Paste" onclick="Copy_CNChanged(id)"/>
                                                            
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td>Site Name</td>
                                                            <td><asp:TextBox ID="SITE_NAME" runat="server" Text='<%# Bind("SITE_NAME") %>'  Width="250px"></asp:TextBox></td>
                                                        </tr>
                                                        <tr>
                                                            <td>% Green(Optional)</td>
                                                            <td><asp:TextBox ID="GREEN_ENERGY_PERCENT" runat="server" Text='<%# Bind("GREEN_ENERGY_PERCENT") %>' Width="20px"></asp:TextBox></td>
                                                        </tr>
                                                    </table>

                                                    
                                                </EditItemTemplate>
                                                <ItemTemplate>

                                                    <table border="0">
                                                        <tr>
                                                            <td>Site Number</td>
                                                            <td><asp:Label ID="TextBox2" runat="server" Text='<%# Bind("SITE_NO") %>'></asp:Label></td>
                                                        </tr>
                                                        <tr>
                                                            <td>Company Name</td>
                                                            <td><asp:Label ID="COMPANY_NAME" runat="server" Text='<%# Bind("COMPANY_NAME") %>'></asp:Label></td>
                                                        </tr>
                                                        <tr>
                                                            <td>Site Name</td>
                                                            <td><asp:Label ID="SITE_NAME" runat="server" Text='<%# Bind("SITE_NAME") %>'></asp:Label></td>
                                                        </tr>
                                                        <tr>
                                                            <td>% Green(Optional)</td>
                                                            <td><asp:Label ID="GREEN_ENERGY_PERCENT" runat="server" Text='<%# Bind("GREEN_ENERGY_PERCENT") %>'></asp:Label></td>
                                                        </tr>
                                                    </table>

                                                </ItemTemplate>
                                            </asp:TemplateField>


                                            <asp:TemplateField HeaderText="ID" SortExpression="ABN">
                                                <EditItemTemplate>

                                                    <table border="0">
                                                        <tr>
                                                            <td>ABN</td>
                                                            <td><asp:TextBox ID="ABN" runat="server" Text='<%# Bind("ABN") %>' onchange="ABNChanged(this.id)"></asp:TextBox></td>
                                                        </tr>
                                                        <tr>
                                                            <td>ACN</td>
                                                            <td><asp:TextBox ID="ACN" runat="server" Text='<%# Bind("ACN") %>'></asp:TextBox></td>
                                                        </tr>
                                                        <tr>
                                                            <td>NMI</td>
                                                            <td><asp:TextBox ID="NMI" runat="server" Text='<%# Bind("NMI") %>' onchange="NMIChanged(this.id)"></asp:TextBox></td>
                                                        </tr>
                                                        <tr>
                                                            <td>Account No.</td>
                                                            <td><asp:TextBox ID="ACCOUNT_NO" runat="server" Text='<%# Bind("ACCOUNT_NO") %>'></asp:TextBox></td>
                                                        </tr>
                                                    </table>

                                                </EditItemTemplate>
                                                <ItemTemplate>

                                                    <table border="0">
                                                        <tr>
                                                            <td>ABN</td>
                                                            <td><asp:Label ID="ABN" runat="server" Text='<%# Bind("ABN") %>'></asp:Label></td>
                                                        </tr>
                                                        <tr>
                                                            <td>ACN</td>
                                                            <td><asp:Label ID="ACN" runat="server" Text='<%# Bind("ACN") %>'></asp:Label></td>
                                                        </tr>
                                                        <tr>
                                                            <td>NMI</td>
                                                            <td><asp:Label ID="NMI" runat="server" Text='<%# Bind("NMI") %>'></asp:Label></td>
                                                        </tr>
                                                        <tr>
                                                            <td>Account No.</td>
                                                            <td><asp:Label ID="ACCOUNT_NO" runat="server" Text='<%# Bind("ACCOUNT_NO") %>'></asp:Label></td>
                                                        </tr>
                                                    </table>


                                                </ItemTemplate>
                                            </asp:TemplateField>

                                            <asp:TemplateField HeaderText="Site Address" SortExpression="SITE_ADDRESS">
                                                <EditItemTemplate>
                                                    <table border="0">
                                                        <tr>
                                                            <td>Address</td>
                                                            <td><asp:TextBox ID="SITE_ADDRESS" runat="server" Text='<%# Bind("SITE_ADDRESS") %>'></asp:TextBox></td>
                                                        </tr>
                                                        <tr>
                                                            <td>Suburb</td>
                                                            <td><asp:TextBox ID="SITE_SUBURB" runat="server" Text='<%# Bind("SITE_SUBURB") %>'></asp:TextBox></td>
                                                        </tr>
                                                        <tr>
                                                            <td>State</td>
                                                            <td>
                                                                <asp:DropDownList ID="SelSITE_STATE" runat="server"
                                                                SelectedValue='<%# Bind("SITE_STATE") %>'  onchange="SelSITE_STATEChanged(id)">
                                                                    <asp:ListItem Value="">Select...</asp:ListItem>
                                                                    <asp:ListItem>VIC</asp:ListItem>
                                                                    <asp:ListItem>NSW</asp:ListItem>
                                                                    <asp:ListItem>WA</asp:ListItem>
                                                                    <asp:ListItem>TAS</asp:ListItem>
                                                                    <asp:ListItem>NT</asp:ListItem>
                                                                    <asp:ListItem>SA</asp:ListItem>
                                                                    <asp:ListItem>QLD</asp:ListItem>
                                                                    <asp:ListItem>ACT</asp:ListItem>
                                                                </asp:DropDownList>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td>Postcode</td>
                                                            <td><asp:TextBox ID="SITE_POSTCODE" runat="server" Text='<%# Bind("SITE_POSTCODE") %>'></asp:TextBox></td>
                                                        </tr>
                                                    </table>


                                                </EditItemTemplate>
                                                <ItemTemplate>
                                                    <table border="0">
                                                        <tr>
                                                            <td>Address</td>
                                                            <td><asp:Label ID="SITE_ADDRESS" runat="server" Text='<%# Bind("SITE_ADDRESS") %>'></asp:Label></td>
                                                        </tr>
                                                        <tr>
                                                            <td>Suburb</td>
                                                            <td><asp:Label ID="SITE_SUBURB" runat="server" Text='<%# Bind("SITE_SUBURB") %>'></asp:Label></td>
                                                        </tr>
                                                        <tr>
                                                            <td>State</td>
                                                            <td><asp:Label ID="SITE_STATE" runat="server" Text='<%# Bind("SITE_STATE") %>'></asp:Label></td>
                                                        </tr>
                                                        <tr>
                                                            <td>Postcode</td>
                                                            <td><asp:Label ID="SITE_POSTCODE" runat="server" Text='<%# Bind("SITE_POSTCODE") %>'></asp:Label></td>
                                                        </tr>
                                                    </table>

                                                    
                                                </ItemTemplate>
                                            </asp:TemplateField>


                                            <asp:TemplateField HeaderText="Kwh Volume pa" SortExpression="PA_PK">
                                                <EditItemTemplate>
                                                    <table border="0">
                                                        <tr>
                                                            <td>PK</td>
                                                            <td><asp:TextBox ID="PA_PK" runat="server" Text='<%# Bind("PA_PK") %>' Style="text-align: center"  onchange="PA_TOTALChanged(id)"></asp:TextBox></td>
                                                        </tr>
                                                        <tr>
                                                            <td><asp:Label ID="lblPA_SH" runat="server" Text="SH(NSW Only)" ></asp:Label></td>
                                                            <td><asp:TextBox ID="PA_SH" runat="server" Text='<%# Bind("PA_SH") %>' Style="text-align: center"  onchange="PA_TOTALChanged(id)"></asp:TextBox></td>
                                                        </tr>
                                                        <tr>
                                                            <td>OP</td>
                                                            <td><asp:TextBox ID="PA_OP" runat="server" Text='<%# Bind("PA_OP") %>' Style="text-align: center"  onchange="PA_TOTALChanged(id)"></asp:TextBox></td>
                                                        </tr>
                                                        <tr>
                                                            <td>Total</td>
                                                            <td>
                                                            <asp:TextBox ID="PA_TOTAL" runat="server" Text='<%# Bind("PA_TOTAL") %>' Style="text-align: center"></asp:TextBox>
                                                            </td>
                                                        </tr>
                                                    </table>

                                                </EditItemTemplate>
                                                <ItemTemplate>

                                                    <table border="0">
                                                        <tr>
                                                            <td>PK</td>
                                                            <td><asp:Label ID="PA_PK" runat="server" Text='<%# Bind("PA_PK") %>'></asp:Label></td>
                                                        </tr>
                                                        <tr>
                                                            <td>SH</td>
                                                            <td><asp:Label ID="PA_SH" runat="server" Text='<%# Bind("PA_SH") %>'></asp:Label></td>
                                                        </tr>
                                                        <tr>
                                                            <td>OP</td>
                                                            <td><asp:Label ID="PA_OP" runat="server" Text='<%# Bind("PA_OP") %>'></asp:Label></td>
                                                        </tr>
                                                        <tr>
                                                            <td>Total</td>
                                                            <td><asp:Label ID="PA_TOTAL" runat="server" Text='<%# Bind("PA_TOTAL") %>'></asp:Label></td>
                                                        </tr>
                                                    </table>


                                                </ItemTemplate>
                                            </asp:TemplateField>

                                            <asp:TemplateField HeaderText="Date" SortExpression="START_DATE">
                                                <EditItemTemplate>

                                                    <table border="0">
                                                        <tr>
                                                            <td>Start Date</td>
                                                            <td><asp:TextBox ID="START_DATE" runat="server" Text='<%# Bind("START_DATE") %>'  onclick="WdatePicker()"></asp:TextBox>
                                                            <br/><input type="button" ID="Copy_SD" runat="server" value="Paste" onclick="Copy_SDChanged(id)"/>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td>End Date</td>
                                                            <td>
                                                            
                                                            
                                                            <asp:TextBox ID="END_DATE" runat="server" Text='<%# Bind("END_DATE") %>'  onclick="WdatePicker()"></asp:TextBox>
                                                            <br/><input type="button" ID="Copy_ED" runat="server" value="Paste" onclick="Copy_EDChanged(id)"/>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td>Comment</td>
                                                            <td>
                                                                <asp:TextBox ID="Comments" Rows="3" cols="60" Width="200" runat="server" TextMode="MultiLine"
                                                                 Text='<%# Bind("COMMENT") %>'></asp:TextBox>
                                                            </td>
                                                        
                                                        </tr>
                                                        <tr>
                                                            <td>Est.PA Spend$</td>
                                                            <td><asp:TextBox ID="PA_SPEND" runat="server" Text='<%# Bind("PA_SPEND") %>'></asp:TextBox>
                                                            <asp:RegularExpressionValidator ID="PA_SPENDVali" runat="server" 
                                                                ControlToValidate="PA_SPEND" ErrorMessage="Numbers Only" 
                                                                ValidationExpression="\d+"></asp:RegularExpressionValidator>
                                                            
                                                            
                                                            </td>
                                                        </tr>

                                                    </table>


                                                </EditItemTemplate>
                                                <ItemTemplate>

                                                    <table border="0">
                                                        <tr>
                                                            <td>Start Date</td>
                                                            <td><asp:Label ID="START_DATE" runat="server" Text='<%# Bind("START_DATE") %>'></asp:Label></td>
                                                        </tr>
                                                        <tr>
                                                            <td>End Date</td>
                                                            <td><asp:Label ID="END_DATE" runat="server" Text='<%# Bind("END_DATE") %>'></asp:Label></td>
                                                        </tr>
                                                        <tr>
                                                            <td>Comment</td>
                                                            <td><asp:Label ID="COMMENT" runat="server" Text='<%# Bind("COMMENT") %>'></asp:Label></td>
                                                        </tr>
                                                        <tr>
                                                            <td>Est.PA Spend$</td>
                                                            <td><asp:Label ID="PA_SPEND" runat="server" Text='<%# Bind("PA_SPEND") %>'></asp:Label></td>
                                                        </tr>
                                                    </table>

                                                </ItemTemplate>
                                            </asp:TemplateField>




                                        </Columns>
                                    </asp:GridView>
                                    <asp:Button ID="btnAddSite" runat="server" onclick="AddElecSite_OnClick" 
                                        Text="Add" />

                                    <asp:HyperLink ID="HyperLink1" runat="server" 
                                        NavigateUrl="~/CI_ELE_AUTH_GENERATOR.aspx" Font-Bold="True">Auth Generator</asp:HyperLink>

                                </EditItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Customer authorisation form received from customer?" 
                                SortExpression="ELEC_CUSTOMER_AUTH">
                                <EditItemTemplate>
                                    <asp:DropDownList ID="SelELEC_CUSTOMER_AUTH" runat="server" 
                                        onchange="ELEC_CUSTOMER_AUTHChanged()" 
                                        SelectedValue='<%# Bind("ELEC_CUSTOMER_AUTH") %>'>
                                        <asp:ListItem>Yes</asp:ListItem>
                                        <asp:ListItem Value="">No</asp:ListItem>
                                    </asp:DropDownList>
                                    <asp:Label ID="lblELEC_CUSTOMER_AUTH_DATE" runat="server" Text="Received Date"></asp:Label>
                                    <asp:TextBox ID="ELEC_CUSTOMER_AUTH_DATE" runat="server" 
                                        onclick="WdatePicker()" Text='<%# Bind("ELEC_CUSTOMER_AUTH_DATE") %>'></asp:TextBox>
                                </EditItemTemplate>
                                <InsertItemTemplate>
                                    <asp:DropDownList ID="SelELEC_CUSTOMER_AUTH" runat="server" 
                                        onchange="ELEC_CUSTOMER_AUTHChanged()" 
                                        SelectedValue='<%# Bind("ELEC_CUSTOMER_AUTH") %>'>
                                        <asp:ListItem>Yes</asp:ListItem>
                                        <asp:ListItem Value="">No</asp:ListItem>
                                    </asp:DropDownList>
                                    <asp:Label ID="lblELEC_CUSTOMER_AUTH_DATE" runat="server" Text="Received Date"></asp:Label>
                                    <asp:TextBox ID="ELEC_CUSTOMER_AUTH_DATE" runat="server" 
                                        onclick="WdatePicker()" Text='<%# Bind("ELEC_CUSTOMER_AUTH_DATE") %>'></asp:TextBox>
                                </InsertItemTemplate>
                                <ItemTemplate>
                                    <asp:Label ID="Label13" runat="server" Text='<%# Bind("ELEC_CUSTOMER_AUTH") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Electricity RFP Status Details">
                                <EditItemTemplate>
                                    <asp:SqlDataSource ID="SqlDataSource7" runat="server" 
                                        ConnectionString="<%$ ConnectionStrings:SQLServer2005DBConnectionString %>" 
                                        DeleteCommand="DELETE FROM [tblCI_ELEC_RFP_DETAIL] WHERE [ID] = @ID" 
                                        InsertCommand="INSERT INTO [tblCI_ELEC_RFP_DETAIL] ([USERID], [RETAILER], [PRICE_STATUS], [RFP_SENT_DATE], [PROPOSAL_RECEIVED_DATE], [OFFER_STATUS], [COMMENT]) VALUES (@USERID, @RETAILER, @PRICE_STATUS, @RFP_SENT_DATE, @PROPOSAL_RECEIVED_DATE, @OFFER_STATUS, @COMMENT)" 
                                        SelectCommand="SELECT * FROM [tblCI_ELEC_RFP_DETAIL] WHERE ([USERID] = @USERID)" 
                                        UpdateCommand="UPDATE [tblCI_ELEC_RFP_DETAIL] SET  [RETAILER] = @RETAILER, [PRICE_STATUS] = @PRICE_STATUS, [RFP_SENT_DATE] = @RFP_SENT_DATE, [PROPOSAL_RECEIVED_DATE] = @PROPOSAL_RECEIVED_DATE, [OFFER_STATUS] = @OFFER_STATUS, [COMMENT] = @COMMENT WHERE [ID] = @ID">
                                        <DeleteParameters>
                                            <asp:Parameter Name="ID" Type="Int32" />
                                        </DeleteParameters>
                                        <InsertParameters>
                                          
                                            <asp:Parameter Name="RETAILER" Type="String" />
                                            <asp:Parameter Name="PRICE_STATUS" Type="String" />
                                            <asp:Parameter Name="RFP_SENT_DATE" Type="String" />
                                            <asp:Parameter Name="PROPOSAL_RECEIVED_DATE" Type="String" />
                                            <asp:Parameter Name="OFFER_STATUS" Type="String" />
                                            <asp:Parameter Name="COMMENT" Type="String" />
                                        </InsertParameters>
                                        <SelectParameters>
                                            <asp:ControlParameter ControlID="GridView1" Name="USERID" 
                                                PropertyName="SelectedValue" Type="Int32" />
                                        </SelectParameters>
                                        <UpdateParameters>
                                           
                                            <asp:Parameter Name="RETAILER" Type="String" />
                                            <asp:Parameter Name="PRICE_STATUS" Type="String" />
                                            <asp:Parameter Name="RFP_SENT_DATE" Type="String" />
                                            <asp:Parameter Name="PROPOSAL_RECEIVED_DATE" Type="String" />
                                            <asp:Parameter Name="OFFER_STATUS" Type="String" />
                                            <asp:Parameter Name="COMMENT" Type="String" />
                                            <asp:Parameter Name="ID" Type="Int32" />
                                        </UpdateParameters>
                                    </asp:SqlDataSource>
                                    <asp:GridView ID="GridView4" runat="server" AutoGenerateColumns="False" 
                                        DataKeyNames="ID" DataSourceID="SqlDataSource7" EnableModelValidation="True">
                                        <Columns>
                                            <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
                                            <asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False" 
                                                ReadOnly="True" SortExpression="ID" Visible="false"/>

                                            <asp:TemplateField HeaderText="Retailer" SortExpression="RETAILER">
                                                <EditItemTemplate>

                                                    <asp:DropDownList ID="SelRETAILER" runat="server" 
                                                        SelectedValue='<%# Bind("RETAILER") %>'>
                                                        <asp:ListItem Value="">Select...</asp:ListItem>
                                                        <asp:ListItem Value="AGL">AGL</asp:ListItem>
                                                        <asp:ListItem Value="Alinta">Alinta</asp:ListItem>
                                                        <asp:ListItem Value="Aurora Energy Pty Ltd">Aurora Energy Pty Ltd</asp:ListItem>
                                                        <asp:ListItem Value="Australian Power and Gas">Australian Power and Gas</asp:ListItem>
                                                        <asp:ListItem Value="BlueNRG">BlueNRG</asp:ListItem>
                                                        <asp:ListItem Value="Click Energy">Click Energy</asp:ListItem>
                                                        <asp:ListItem Value="Cogent Energy">Cogent Energy</asp:ListItem>
                                                        <asp:ListItem Value="Essential Energy">Essential Energy</asp:ListItem>
                                                        <asp:ListItem Value="Country Energy">Country Energy</asp:ListItem>
                                                        <asp:ListItem Value="Delta Electricity">Delta Electricity</asp:ListItem>
                                                        <asp:ListItem Value="Diamond Energy">Diamond Energy</asp:ListItem>
                                                        <asp:ListItem Value="Dodo Power &amp; Gas">Dodo Power &amp; Gas</asp:ListItem>
                                                        <asp:ListItem Value="Energy Australia">Energy Australia</asp:ListItem>
                                                        <asp:ListItem Value="Ergon Energy Queensland">Ergon Energy Queensland</asp:ListItem>
                                                        <asp:ListItem Value="ERM Power Retail Pty Ltd">ERM Power Retail Pty Ltd</asp:ListItem>
                                                        <asp:ListItem Value="Eraring Energy">Eraring Energy</asp:ListItem>
                                                        <asp:ListItem Value="Essential Energy">Essential Energy</asp:ListItem>
                                                        <asp:ListItem Value="Flinders Power Holding GmbH">Flinders Power Holding GmbH</asp:ListItem>
                                                        <asp:ListItem Value="GridX Pty Ltd">GridX Pty Ltd</asp:ListItem>
                                                        <asp:ListItem Value="Independent Electricity Retail Solutions Pty Ltd">Independent Electricity Retail Solutions Pty Ltd</asp:ListItem>
                                                        <asp:ListItem Value="Integral Energy Australia">Integral Energy Australia</asp:ListItem>
                                                        <asp:ListItem Value="Lumo Energy">Lumo Energy</asp:ListItem>
                                                        <asp:ListItem Value="Momentum Energy">Momentum Energy</asp:ListItem>
                                                        <asp:ListItem Value="Neighbourhood Energy">Neighbourhood Energy</asp:ListItem>
                                                        <asp:ListItem Value="Origin Energy">Origin Energy</asp:ListItem>
                                                        <asp:ListItem Value="Powerdirect">Powerdirect</asp:ListItem>
                                                        <asp:ListItem Value="Qenergy">Qenergy</asp:ListItem>
                                                        <asp:ListItem Value="Red Energy">Red Energy</asp:ListItem>
                                                        <asp:ListItem Value="Sanctuary Energy">Sanctuary Energy</asp:ListItem>
                                                        <asp:ListItem Value="Simply Energy">Simply Energy</asp:ListItem>
                                                        <asp:ListItem Value="Tarong Energy">Tarong Energy </asp:ListItem>
                                                        <asp:ListItem Value="TRUenergy">TRUenergy</asp:ListItem>
                                                        <asp:ListItem Value="Trustpower Australia">Trustpower Australia</asp:ListItem>
                                                        <asp:ListItem Value="Victoria Electricity">Victoria Electricity</asp:ListItem>
                                                    </asp:DropDownList>



                                                </EditItemTemplate>
                                                <ItemTemplate>
                                                    <asp:Label ID="Label6" runat="server" Text='<%# Bind("RETAILER") %>'></asp:Label>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            
                                            <asp:TemplateField HeaderText="RFP Sent Date" SortExpression="RFP_SENT_DATE">
                                                <EditItemTemplate>
                                                    <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("RFP_SENT_DATE") %>'   onclick="WdatePicker()"></asp:TextBox>
                                                </EditItemTemplate>
                                                <ItemTemplate>
                                                    <asp:Label ID="Label2" runat="server" Text='<%# Bind("RFP_SENT_DATE") %>' ></asp:Label>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Proposal Received Date" 
                                                SortExpression="PROPOSAL_RECEIVED_DATE">
                                                <EditItemTemplate>
                                                    <asp:TextBox ID="TextBox2" runat="server" 
                                                        Text='<%# Bind("PROPOSAL_RECEIVED_DATE") %>'   onclick="WdatePicker()"></asp:TextBox>
                                                </EditItemTemplate>
                                                <ItemTemplate>
                                                    <asp:Label ID="Label3" runat="server" 
                                                        Text='<%# Bind("PROPOSAL_RECEIVED_DATE") %>'></asp:Label>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Proposal Sent to Customer Date" SortExpression="PRICE_STATUS">
                                                <EditItemTemplate>
                                                    <asp:TextBox ID="PRICE_STATUS" runat="server" Text='<%# Bind("PRICE_STATUS") %>'  onclick="WdatePicker()"></asp:TextBox>
                                                </EditItemTemplate>
                                                <ItemTemplate>
                                                    <asp:Label ID="lblPRICE_STATUS" runat="server" Text='<%# Bind("PRICE_STATUS") %>'></asp:Label>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Offer Status" SortExpression="OFFER_STATUS">
                                                <EditItemTemplate>

                                                    <asp:DropDownList ID="SelOFFER_STATUS" runat="server" SelectedValue='<%# Bind("OFFER_STATUS") %>'>
                                                        <asp:ListItem Value="">Select...</asp:ListItem>
                                                        <asp:ListItem>Waiting for retailer proposal</asp:ListItem>
                                                        <asp:ListItem>Proposal received from retailer</asp:ListItem>
                                                        <asp:ListItem>Proposal sent to customer</asp:ListItem>
                                                        <asp:ListItem>Customer accepted offer</asp:ListItem>
                                                        <asp:ListItem>Customer rejected offer</asp:ListItem>
                                                        <asp:ListItem>Retailer no bid</asp:ListItem>
                                                    </asp:DropDownList>
                                                </EditItemTemplate>
                                                <ItemTemplate>
                                                    <asp:Label ID="Label4" runat="server" Text='<%# Bind("OFFER_STATUS") %>'></asp:Label>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Price Feedback/Comment" SortExpression="COMMENT">
                                                <EditItemTemplate>
                                                    <asp:TextBox ID="RFPComments" Rows="2" cols="60" Width="260" runat="server" TextMode="MultiLine"
                                                    Text='<%# Bind("COMMENT") %>'></asp:TextBox>
                                                </EditItemTemplate>
                                                <ItemTemplate>
                                                    <asp:Label ID="Label1" runat="server" Text='<%# Bind("COMMENT") %>'></asp:Label>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                        </Columns>
                                    </asp:GridView>
                                    <asp:Button ID="btnAddRPF" runat="server" onclick="AddElecRPF_OnClick" 
                                        Text="Add" />

                                    <asp:HyperLink ID="btnRPF" runat="server" 
                                        NavigateUrl="~/CI_ELE_RPF_GENERATOR.aspx" Font-Bold="True">RPF Generator</asp:HyperLink>


                                </EditItemTemplate>
                            </asp:TemplateField>
                            <asp:CommandField ShowEditButton="True" />
                        </Fields>
                        <PagerStyle CssClass="pgr" />

                    </asp:DetailsView>

                
            </asp:View>

            

        </asp:MultiView>
        <asp:MultiView ID="MultiView2" runat="server" ActiveViewIndex="0">
            <asp:View ID="View3" runat="server">
            </asp:View>
            <asp:View ID="View4" runat="server">
            <h1>Gas Form</h1>
                   <asp:DetailsView ID="DetailsView3" runat="Server" CellPadding="4" ForeColor="#333333"
                        GridLines="None" DataSourceID="SqlDataSource4" AllowPaging="True" AutoGenerateRows="False"
                        DataKeyNames="userID" DefaultMode="Edit" CssClass="mGrid" FieldHeaderStyle-Font-Bold="true" 
                        Font-Names="Times New Roman" CommandRowStyle-Font-Size="13" CommandRowStyle-ForeColor="red"
                        PagerStyle-CssClass="pgr" AlternatingRowStyle-CssClass="alt" 
                        OnItemUpdated="DetailsView3_ItemUpdated"    
                            EnableModelValidation="True">
                        <AlternatingRowStyle CssClass="alt"></AlternatingRowStyle>
                        <Fields>


                            <asp:TemplateField HeaderText="USERID" InsertVisible="False" 
                                SortExpression="USERID">
                                <EditItemTemplate>
                                    <asp:Label ID="Label1" runat="server" Text='<%# Eval("USERID") %>'></asp:Label>
                                </EditItemTemplate>

                                <ItemTemplate>
                                    <asp:Label ID="Label12" runat="server" Text='<%# Bind("USERID") %>'></asp:Label>
                                </ItemTemplate>

                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Current Gas Retailer" 
                                SortExpression="GAS_CURRENT_RETAILER">
                                <EditItemTemplate>


                                    <asp:TextBox ID="GAS_CURRENT_RETAILER" runat="server" Text='<%# Bind("GAS_CURRENT_RETAILER") %>'></asp:TextBox>
       
                                    <asp:DropDownList name="SelGAS_CURRENT_RETAILER" ID="SelGAS_CURRENT_RETAILER" runat="Server" onchange="SelGAS_CURRENT_RETAILERChanged()"
                                                 DataSourceID="SqlDataSource9" DataTextField="CurrentProviderName" DataValueField="CurrentProviderName" />


                                </EditItemTemplate>

                                <InsertItemTemplate>
                                    <asp:TextBox ID="TextBox1" runat="server" 
                                        Text='<%# Bind("GAS_CURRENT_RETAILER") %>'></asp:TextBox>
                                </InsertItemTemplate>
                                <ItemTemplate>
                                    <asp:Label ID="Label1" runat="server" 
                                        Text='<%# Bind("GAS_CURRENT_RETAILER") %>'></asp:Label>
                                </ItemTemplate>

                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Price Type Requested" SortExpression="GAS_PRICE_TYPE">
                                <EditItemTemplate>

                                    <asp:DropDownList ID="SelGAS_PRICE_TYPE" runat="server" SelectedValue='<%# Bind("GAS_PRICE_TYPE") %>'>
                                                        <asp:ListItem Value="">Firm</asp:ListItem>
                                                        <asp:ListItem>Indicative</asp:ListItem>

                                    </asp:DropDownList>
                                </EditItemTemplate>
                                <InsertItemTemplate>
                                    <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("GAS_PRICE_TYPE") %>'></asp:TextBox>
                                </InsertItemTemplate>
                                <ItemTemplate>
                                    <asp:Label ID="Label2" runat="server" Text='<%# Bind("GAS_PRICE_TYPE") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Contract Start Date" 
                                SortExpression="GAS_CONTRACT_START_DATE">
                                <EditItemTemplate>
                                    <asp:TextBox ID="GAS_CONTRACT_START_DATE" runat="server" 
                                        Text='<%# Bind("GAS_CONTRACT_START_DATE") %>' onclick="WdatePicker()" onchange="SelGAS_CONTRACT_TERMChanged()"></asp:TextBox>
                                </EditItemTemplate>
                                <InsertItemTemplate>
                                    <asp:TextBox ID="TextBox3" runat="server" 
                                        Text='<%# Bind("GAS_CONTRACT_START_DATE") %>'></asp:TextBox>
                                </InsertItemTemplate>
                                <ItemTemplate>
                                    <asp:Label ID="Label3" runat="server" 
                                        Text='<%# Bind("GAS_CONTRACT_START_DATE") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Contract Term" 
                                SortExpression="GAS_CONTRACT_TERM">
                                <EditItemTemplate>

                                   <asp:DropDownList ID="SelGAS_CONTRACT_TERM" runat="server" SelectedValue='<%# Bind("GAS_CONTRACT_TERM") %>' onchange="SelGAS_CONTRACT_TERMChanged()">
                                                        <asp:ListItem Value="">Select...</asp:ListItem>
                                                        <asp:ListItem>1</asp:ListItem>
                                                        <asp:ListItem>2</asp:ListItem>
                                                        <asp:ListItem>3</asp:ListItem>
                                                        <asp:ListItem>4</asp:ListItem>
                                                        <asp:ListItem>5</asp:ListItem>
                                                        <asp:ListItem>6</asp:ListItem>
                                    </asp:DropDownList>
                                    <asp:Label ID="lblGAS_CONTRACT_TERM" runat="server" Text="Year"></asp:Label>


                                </EditItemTemplate>
                                <InsertItemTemplate>
                                    <asp:TextBox ID="TextBox4" runat="server" 
                                        Text='<%# Bind("GAS_CONTRACT_TERM") %>'></asp:TextBox>
                                </InsertItemTemplate>
                                <ItemTemplate>
                                    <asp:Label ID="Label4" runat="server" Text='<%# Bind("GAS_CONTRACT_TERM") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Individual Year Option" 
                                SortExpression="GAS_INDIVIDUAL_YEAR_OPTION">
                                <EditItemTemplate>

                                    <asp:DropDownList ID="SelGAS_INDIVIDUAL_YEAR_OPTION" runat="server" SelectedValue='<%# Bind("GAS_INDIVIDUAL_YEAR_OPTION") %>'>
                                                        <asp:ListItem>Yes</asp:ListItem>
                                                        <asp:ListItem Value="">No</asp:ListItem>
                                    </asp:DropDownList>

                                </EditItemTemplate>
                                <InsertItemTemplate>
                                    <asp:TextBox ID="TextBox118" runat="server" 
                                        Text='<%# Bind("GAS_INDIVIDUAL_YEAR_OPTION") %>'></asp:TextBox>
                                </InsertItemTemplate>
                                <ItemTemplate>
                                    <asp:Label ID="Label118" runat="server" 
                                        Text='<%# Bind("GAS_INDIVIDUAL_YEAR_OPTION") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Contract End Date" 
                                SortExpression="GAS_CONTRACT_END_DATE">
                                <EditItemTemplate>
                                    <asp:TextBox ID="GAS_CONTRACT_END_DATE" runat="server" 
                                        Text='<%# Bind("GAS_CONTRACT_END_DATE") %>' onclick="WdatePicker()"></asp:TextBox>
                                </EditItemTemplate>
                                <InsertItemTemplate>
                                    <asp:TextBox ID="TextBox5" runat="server" 
                                        Text='<%# Bind("GAS_CONTRACT_END_DATE") %>'></asp:TextBox>
                                </InsertItemTemplate>
                                <ItemTemplate>
                                    <asp:Label ID="Label5" runat="server" 
                                        Text='<%# Bind("GAS_CONTRACT_END_DATE") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Alternative End Date" 
                                SortExpression="GAS_ALTER_END_DATE">
                                <EditItemTemplate>
                                    <asp:TextBox ID="GAS_ALTER_END_DATE" runat="server" 
                                        Text='<%# Bind("GAS_ALTER_END_DATE") %>' onclick="WdatePicker()" onchange="GAS_ALTER_END_DATEChanged()"></asp:TextBox>
                                </EditItemTemplate>
                                <InsertItemTemplate>
                                    <asp:TextBox ID="TextBox6" runat="server" 
                                        Text='<%# Bind("GAS_ALTER_END_DATE") %>'></asp:TextBox>
                                </InsertItemTemplate>
                                <ItemTemplate>
                                    <asp:Label ID="Label6" runat="server" Text='<%# Bind("GAS_ALTER_END_DATE") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Price required by COB" SortExpression="GAS_PRICE_COB">
                                <EditItemTemplate>
                                    <asp:TextBox ID="TextBox7" runat="server" Text='<%# Bind("GAS_PRICE_COB") %>' onclick="WdatePicker()"></asp:TextBox>
                                </EditItemTemplate>
                                <InsertItemTemplate>
                                    <asp:TextBox ID="TextBox7" runat="server" Text='<%# Bind("GAS_PRICE_COB") %>'></asp:TextBox>
                                </InsertItemTemplate>
                                <ItemTemplate>
                                    <asp:Label ID="Label7" runat="server" Text='<%# Bind("GAS_PRICE_COB") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Data Provided by Customer" 
                                SortExpression="GAS_DATA_PROVIDED">
                                <EditItemTemplate>
                                   <asp:DropDownList ID="SelGAS_DATA_PROVIDED" runat="server" SelectedValue='<%# Bind("GAS_DATA_PROVIDED") %>'>
                                                        <asp:ListItem Value="">Select...</asp:ListItem>
                                                        <asp:ListItem>Interval meter data</asp:ListItem>
                                                        <asp:ListItem>Bill copy or papersummary</asp:ListItem>
                                                        <asp:ListItem>no data provided</asp:ListItem>
                                    </asp:DropDownList>


                                </EditItemTemplate>
                                <InsertItemTemplate>
                                    <asp:TextBox ID="TextBox8" runat="server" 
                                        Text='<%# Bind("GAS_DATA_PROVIDED") %>'></asp:TextBox>
                                </InsertItemTemplate>
                                <ItemTemplate>
                                    <asp:Label ID="Label8" runat="server" Text='<%# Bind("GAS_DATA_PROVIDED") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Gas Site Details">
                                <EditItemTemplate>
                                    <asp:SqlDataSource ID="SqlDataSource6" runat="server" 
                                        ConnectionString="<%$ ConnectionStrings:SQLServer2005DBConnectionString %>" 
                                        DeleteCommand="DELETE FROM [tblCI_GAS_SITE_DETAIL] WHERE [ID] = @ID" 
                                        InsertCommand="INSERT INTO [tblCI_GAS_SITE_DETAIL] ([USERID], [SITE_NO], [COMPANY_NAME], [ABN], [ACN], [MIRN], [ACCOUNT_NO], [SITE_NAME], [SITE_ADDRESS], [SITE_SUBURB], [SITE_STATE], [SITE_POSTCODE], [PA_GAS_TOTAL], [START_DATE], [END_DATE], [COMMENT], [PA_SPEND]) VALUES (@USERID, @SITE_NO, @COMPANY_NAME, @ABN, @ACN, @MIRN, @ACCOUNT_NO, @SITE_NAME, @SITE_ADDRESS, @SITE_SUBURB, @SITE_STATE, @SITE_POSTCODE, @PA_GAS_TOTAL, @START_DATE, @END_DATE, @COMMENT, @PA_SPEND)" 
                                        SelectCommand="SELECT * FROM [tblCI_GAS_SITE_DETAIL] WHERE ([USERID] = @USERID)" 
                                        UpdateCommand="UPDATE [tblCI_GAS_SITE_DETAIL] SET[SITE_NO] = @SITE_NO, [COMPANY_NAME] = @COMPANY_NAME, [ABN] = @ABN, [ACN] = @ACN, [MIRN] = @MIRN, [ACCOUNT_NO] = @ACCOUNT_NO, [SITE_NAME] = @SITE_NAME, [SITE_ADDRESS] = @SITE_ADDRESS, [SITE_SUBURB] = @SITE_SUBURB, [SITE_STATE] = @SITE_STATE, [SITE_POSTCODE] = @SITE_POSTCODE, [PA_GAS_TOTAL] = @PA_GAS_TOTAL, [START_DATE] = @START_DATE, [END_DATE] = @END_DATE, [COMMENT] = @COMMENT , [PA_SPEND] = @PA_SPEND WHERE [ID] = @ID">
                                        <DeleteParameters>
                                            <asp:Parameter Name="ID" Type="Int32" />
                                        </DeleteParameters>
                                        <InsertParameters>
                                         
                                            <asp:Parameter Name="SITE_NO" Type="Int32" />
                                            <asp:Parameter Name="COMPANY_NAME" Type="String" />
                                            <asp:Parameter Name="ABN" Type="String" />
                                            <asp:Parameter Name="ACN" Type="String" />
                                            <asp:Parameter Name="MIRN" Type="String" />
                                            <asp:Parameter Name="ACCOUNT_NO" Type="String" />
                                            <asp:Parameter Name="SITE_NAME" Type="String" />
                                            <asp:Parameter Name="SITE_ADDRESS" Type="String" />
                                            <asp:Parameter Name="SITE_SUBURB" Type="String" />
                                            <asp:Parameter Name="SITE_STATE" Type="String" />
                                            <asp:Parameter Name="SITE_POSTCODE" Type="String" />
                                            <asp:Parameter Name="PA_GAS_TOTAL" Type="String" />
                                            <asp:Parameter Name="START_DATE" Type="String" />
                                            <asp:Parameter Name="END_DATE" Type="String" />
                                            <asp:Parameter Name="COMMENT" Type="String" />
                                            <asp:Parameter Name="PA_SPEND" Type="Int32" />
                                        </InsertParameters>
                                        <SelectParameters>
                                            <asp:ControlParameter ControlID="GridView1" Name="USERID" 
                                                PropertyName="SelectedValue" Type="Int32" />
                                        </SelectParameters>
                                        <UpdateParameters>
                                           
                                            <asp:Parameter Name="SITE_NO" Type="Int32" />
                                            <asp:Parameter Name="COMPANY_NAME" Type="String" />
                                            <asp:Parameter Name="ABN" Type="String" />
                                            <asp:Parameter Name="ACN" Type="String" />
                                            <asp:Parameter Name="MIRN" Type="String" />
                                            <asp:Parameter Name="ACCOUNT_NO" Type="String" />
                                            <asp:Parameter Name="SITE_NAME" Type="String" />
                                            <asp:Parameter Name="SITE_ADDRESS" Type="String" />
                                            <asp:Parameter Name="SITE_SUBURB" Type="String" />
                                            <asp:Parameter Name="SITE_STATE" Type="String" />
                                            <asp:Parameter Name="SITE_POSTCODE" Type="String" />
                                            <asp:Parameter Name="PA_GAS_TOTAL" Type="String" />
                                            <asp:Parameter Name="START_DATE" Type="String" />
                                            <asp:Parameter Name="END_DATE" Type="String" />
                                            <asp:Parameter Name="COMMENT" Type="String" />
                                            <asp:Parameter Name="PA_SPEND" Type="Int32" />
                                            <asp:Parameter Name="ID" Type="Int32" />
                                        </UpdateParameters>
                                    </asp:SqlDataSource>
                                    <asp:GridView ID="GridView3" runat="server" AutoGenerateColumns="False" 
                                        DataKeyNames="ID" DataSourceID="SqlDataSource6" EnableModelValidation="True">
                                        <Columns>
                                            <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
                                            <asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False" 
                                                ReadOnly="True" SortExpression="ID"  Visible="false"/>

                                            

                                            <asp:TemplateField HeaderText="Site Info" SortExpression="SITE_NO">
                                                <EditItemTemplate>

                                                    <table border="0">
                                                        <tr>
                                                            <td>Site Number</td>
                                                            <td><asp:TextBox ID="SITE_NO" runat="server" Text='<%# Bind("SITE_NO") %>' Width="20px"></asp:TextBox></td>
                                                        </tr>
                                                        <tr>
                                                            <td>Company Name</td>
                                                            <td><asp:TextBox ID="COMPANY_NAME" runat="server" Text='<%# Bind("COMPANY_NAME") %>'  Width="250px"></asp:TextBox>
                                                            <br/><input type="button" ID="Copy_CN" runat="server" value="Paste" onclick="Copy_CNChanged(id)"/>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td>Site Name</td>
                                                            <td><asp:TextBox ID="SITE_NAME" runat="server" Text='<%# Bind("SITE_NAME") %>'  Width="250px"></asp:TextBox></td>
                                                        </tr>
                                                        <tr>
                                                            <td>PA Gas(Gg)</td>
                                                            <td><asp:TextBox ID="PA_GAS_TOTAL" runat="server" Text='<%# Bind("PA_GAS_TOTAL") %>'></asp:TextBox></td>
                                                        </tr>
                                                    </table>

                                                    
                                                </EditItemTemplate>
                                                <ItemTemplate>

                                                    <table border="0">
                                                        <tr>
                                                            <td>Site Number</td>
                                                            <td><asp:Label ID="SITE_NO" runat="server" Text='<%# Bind("SITE_NO") %>'></asp:Label></td>
                                                        </tr>
                                                        <tr>
                                                            <td>Company Name</td>
                                                            <td><asp:Label ID="COMPANY_NAME" runat="server" Text='<%# Bind("COMPANY_NAME") %>'></asp:Label>
                                                            
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td>Site Name</td>
                                                            <td><asp:Label ID="SITE_NAME" runat="server" Text='<%# Bind("SITE_NAME") %>'></asp:Label></td>
                                                        </tr>
                                                        <tr>
                                                            <td>PA Gas(Gg)</td>
                                                            <td><asp:Label ID="PA_GAS_TOTAL" runat="server" Text='<%# Bind("PA_GAS_TOTAL") %>'></asp:Label></td>
                                                        </tr>
                                                    </table>

                                                </ItemTemplate>
                                            </asp:TemplateField>



                                            <asp:TemplateField HeaderText="ID" SortExpression="ABN">
                                                <EditItemTemplate>

                                                    <table border="0">
                                                        <tr>
                                                            <td>ABN</td>
                                                            <td><asp:TextBox ID="ABN" runat="server" Text='<%# Bind("ABN") %>'></asp:TextBox></td>
                                                        </tr>
                                                        <tr>
                                                            <td>ACN</td>
                                                            <td><asp:TextBox ID="ACN" runat="server" Text='<%# Bind("ACN") %>'></asp:TextBox></td>
                                                        </tr>
                                                        <tr>
                                                            <td>MIRN</td>
                                                            <td><asp:TextBox ID="MIRN" runat="server" Text='<%# Bind("MIRN") %>'></asp:TextBox></td>
                                                        </tr>
                                                        <tr>
                                                            <td>Account No.</td>
                                                            <td><asp:TextBox ID="ACCOUNT_NO" runat="server" Text='<%# Bind("ACCOUNT_NO") %>'></asp:TextBox></td>
                                                        </tr>
                                                    </table>

                                                </EditItemTemplate>
                                                <ItemTemplate>

                                                    <table border="0">
                                                        <tr>
                                                            <td>ABN</td>
                                                            <td><asp:Label ID="ABN" runat="server" Text='<%# Bind("ABN") %>'></asp:Label></td>
                                                        </tr>
                                                        <tr>
                                                            <td>ACN</td>
                                                            <td><asp:Label ID="ACN" runat="server" Text='<%# Bind("ACN") %>'></asp:Label></td>
                                                        </tr>
                                                        <tr>
                                                            <td>MIRN</td>
                                                            <td><asp:Label ID="MIRN" runat="server" Text='<%# Bind("MIRN") %>'></asp:Label></td>
                                                        </tr>
                                                        <tr>
                                                            <td>Account No.</td>
                                                            <td><asp:Label ID="ACCOUNT_NO" runat="server" Text='<%# Bind("ACCOUNT_NO") %>'></asp:Label></td>
                                                        </tr>
                                                    </table>


                                                </ItemTemplate>
                                            </asp:TemplateField>


                                            <asp:TemplateField HeaderText="Site Address" SortExpression="SITE_ADDRESS">
                                                <EditItemTemplate>
                                                    <table border="0">
                                                        <tr>
                                                            <td>Address</td>
                                                            <td><asp:TextBox ID="SITE_ADDRESS" runat="server" Text='<%# Bind("SITE_ADDRESS") %>'></asp:TextBox></td>
                                                        </tr>
                                                        <tr>
                                                            <td>Suburb</td>
                                                            <td><asp:TextBox ID="SITE_SUBURB" runat="server" Text='<%# Bind("SITE_SUBURB") %>'></asp:TextBox></td>
                                                        </tr>
                                                        <tr>
                                                            <td>State</td>
                                                            <td>
                                                                <asp:DropDownList ID="SelSITE_STATE" runat="server"
                                                                SelectedValue='<%# Bind("SITE_STATE") %>'>
                                                                    <asp:ListItem Value="">Select...</asp:ListItem>
                                                                    <asp:ListItem>VIC</asp:ListItem>
                                                                    <asp:ListItem>NSW</asp:ListItem>
                                                                    <asp:ListItem>WA</asp:ListItem>
                                                                    <asp:ListItem>TAS</asp:ListItem>
                                                                    <asp:ListItem>NT</asp:ListItem>
                                                                    <asp:ListItem>SA</asp:ListItem>
                                                                    <asp:ListItem>QLD</asp:ListItem>
                                                                    <asp:ListItem>ACT</asp:ListItem>
                                                                </asp:DropDownList>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td>Postcode</td>
                                                            <td><asp:TextBox ID="SITE_POSTCODE" runat="server" Text='<%# Bind("SITE_POSTCODE") %>'></asp:TextBox></td>
                                                        </tr>
                                                    </table>


                                                </EditItemTemplate>
                                                <ItemTemplate>
                                                    <table border="0">
                                                        <tr>
                                                            <td>Address</td>
                                                            <td><asp:Label ID="SITE_ADDRESS" runat="server" Text='<%# Bind("SITE_ADDRESS") %>'></asp:Label></td>
                                                        </tr>
                                                        <tr>
                                                            <td>Suburb</td>
                                                            <td><asp:Label ID="SITE_SUBURB" runat="server" Text='<%# Bind("SITE_SUBURB") %>'></asp:Label></td>
                                                        </tr>
                                                        <tr>
                                                            <td>State</td>
                                                            <td><asp:Label ID="SITE_STATE" runat="server" Text='<%# Bind("SITE_STATE") %>'></asp:Label></td>
                                                        </tr>
                                                        <tr>
                                                            <td>Postcode</td>
                                                            <td><asp:Label ID="SITE_POSTCODE" runat="server" Text='<%# Bind("SITE_POSTCODE") %>'></asp:Label></td>
                                                        </tr>
                                                    </table>

                                                    
                                                </ItemTemplate>
                                            </asp:TemplateField>


                                            <asp:TemplateField HeaderText="Date" SortExpression="START_DATE">
                                                <EditItemTemplate>

                                                    <table border="0">
                                                        <tr>
                                                            <td>Start Date</td>
                                                            <td><asp:TextBox ID="START_DATE" runat="server" Text='<%# Bind("START_DATE") %>'  onclick="WdatePicker()"></asp:TextBox>
                                                            
                                                            <br/><input type="button" ID="Copy_SD" runat="server" value="Paste" onclick="Copy_SDChanged(id)"/>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td>End Date</td>
                                                            <td><asp:TextBox ID="END_DATE" runat="server" Text='<%# Bind("END_DATE") %>'  onclick="WdatePicker()"></asp:TextBox>
                                                            <br/><input type="button" ID="Copy_ED" runat="server" value="Paste" onclick="Copy_EDChanged(id)"/>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td>Comment</td>
                                                            <td>
                                                                <asp:TextBox ID="Comments" Rows="3" cols="60" Width="200" runat="server" TextMode="MultiLine"
                                                                 Text='<%# Bind("COMMENT") %>'></asp:TextBox>
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td>Est.PA Spend$</td>
                                                            <td><asp:TextBox ID="PA_SPEND" runat="server" Text='<%# Bind("PA_SPEND") %>'></asp:TextBox>
                                                            <asp:RegularExpressionValidator ID="PA_SPENDVali" runat="server" 
                                                                ControlToValidate="PA_SPEND" ErrorMessage="Numbers Only" 
                                                                ValidationExpression="\d+"></asp:RegularExpressionValidator>
                                                            
                                                            </td>
                                                        </tr>

                                                    </table>


                                                </EditItemTemplate>
                                                <ItemTemplate>

                                                    <table border="0">
                                                        <tr>
                                                            <td>Start Date</td>
                                                            <td><asp:Label ID="START_DATE" runat="server" Text='<%# Bind("START_DATE") %>'></asp:Label></td>
                                                        </tr>
                                                        <tr>
                                                            <td>End Date</td>
                                                            <td><asp:Label ID="END_DATE" runat="server" Text='<%# Bind("END_DATE") %>'></asp:Label></td>
                                                        </tr>
                                                        <tr>
                                                            <td>Comment</td>
                                                            <td><asp:Label ID="COMMENT" runat="server" Text='<%# Bind("COMMENT") %>'></asp:Label></td>
                                                        </tr>
                                                        <tr>
                                                            <td>Est.PA Spend$</td>
                                                            <td><asp:Label ID="PA_SPEND" runat="server" Text='<%# Bind("PA_SPEND") %>'></asp:Label></td>
                                                        </tr>
                                                    </table>

                                                </ItemTemplate>
                                            </asp:TemplateField>




                                        </Columns>
                                    </asp:GridView>
                                    <asp:Button ID="btnAddSite" runat="server" Text="Add" onclick="AddGasSite_OnClick"/>
                                    <asp:Button ID="btnCAF" runat="server" 
                                        Text="Export customer authorisation form" onclick="GasCAF_OnClick"/>
                                </EditItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Customer authorisation form received from customer?" 
                                SortExpression="GAS_CUSTOMER_AUTH">
                                <EditItemTemplate>
                                    <asp:DropDownList ID="SelGAS_CUSTOMER_AUTH" runat="server" SelectedValue='<%# Bind("GAS_CUSTOMER_AUTH") %>' onchange="GAS_CUSTOMER_AUTHChanged()">
                                                        <asp:ListItem>Yes</asp:ListItem>
                                                        <asp:ListItem Value="">No</asp:ListItem>
                                    </asp:DropDownList>
                                    <asp:Label ID="lblGAS_CUSTOMER_AUTH_DATE" runat="server" Text="Received Date"></asp:Label>
                                    <asp:TextBox ID="GAS_CUSTOMER_AUTH_DATE" runat="server" 
                                        Text='<%# Bind("GAS_CUSTOMER_AUTH_DATE") %>'   onclick="WdatePicker()"></asp:TextBox>
                                </EditItemTemplate>
                                <InsertItemTemplate>
                                    <asp:DropDownList ID="SelGAS_CUSTOMER_AUTH" runat="server" SelectedValue='<%# Bind("GAS_CUSTOMER_AUTH") %>' onchange="GAS_CUSTOMER_AUTHChanged()">
                                                        <asp:ListItem>Yes</asp:ListItem>
                                                        <asp:ListItem Value="">No</asp:ListItem>
                                    </asp:DropDownList>
                                    <asp:Label ID="lblGAS_CUSTOMER_AUTH_DATE" runat="server" Text="Received Date"></asp:Label>
                                    <asp:TextBox ID="GAS_CUSTOMER_AUTH_DATE" runat="server" 
                                        Text='<%# Bind("GAS_CUSTOMER_AUTH_DATE") %>'   onclick="WdatePicker()"></asp:TextBox>
                                
                                </InsertItemTemplate>
                                <ItemTemplate>
                                    <asp:Label ID="Label9" runat="server" Text='<%# Bind("GAS_CUSTOMER_AUTH") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>

                            <asp:TemplateField HeaderText="Gas RFP Status Details">
                                <EditItemTemplate>
                                    <asp:SqlDataSource ID="SqlDataSource8" runat="server" 
                                        ConnectionString="<%$ ConnectionStrings:SQLServer2005DBConnectionString %>" 
                                        DeleteCommand="DELETE FROM [tblCI_GAS_RFP_DETAIL] WHERE [ID] = @ID" 
                                        InsertCommand="INSERT INTO [tblCI_GAS_RFP_DETAIL] ([USERID], [RETAILER], [PRICE_STATUS], [RFP_SENT_DATE], [PROPOSAL_RECEIVED_DATE], [OFFER_STATUS], [COMMENT]) VALUES (@USERID, @RETAILER, @PRICE_STATUS, @RFP_SENT_DATE, @PROPOSAL_RECEIVED_DATE, @OFFER_STATUS, @COMMENT)" 
                                        SelectCommand="SELECT * FROM [tblCI_GAS_RFP_DETAIL] WHERE ([USERID] = @USERID)" 
                                        UpdateCommand="UPDATE [tblCI_GAS_RFP_DETAIL] SET  [RETAILER] = @RETAILER, [PRICE_STATUS] = @PRICE_STATUS, [RFP_SENT_DATE] = @RFP_SENT_DATE, [PROPOSAL_RECEIVED_DATE] = @PROPOSAL_RECEIVED_DATE, [OFFER_STATUS] = @OFFER_STATUS, [COMMENT] = @COMMENT WHERE [ID] = @ID">
                                        <DeleteParameters>
                                            <asp:Parameter Name="ID" Type="Int32" />
                                        </DeleteParameters>
                                        <InsertParameters>
                                  
                                            <asp:Parameter Name="RETAILER" Type="String" />
                                            <asp:Parameter Name="PRICE_STATUS" Type="String" />
                                            <asp:Parameter Name="RFP_SENT_DATE" Type="String" />
                                            <asp:Parameter Name="PROPOSAL_RECEIVED_DATE" Type="String" />
                                            <asp:Parameter Name="OFFER_STATUS" Type="String" />
                                            <asp:Parameter Name="COMMENT" Type="String" />
                                        </InsertParameters>
                                        <SelectParameters>
                                            <asp:ControlParameter ControlID="GridView1" Name="USERID" 
                                                PropertyName="SelectedValue" Type="Int32" />
                                        </SelectParameters>
                                        <UpdateParameters>
                                   
                                            <asp:Parameter Name="RETAILER" Type="String" />
                                            <asp:Parameter Name="PRICE_STATUS" Type="String" />
                                            <asp:Parameter Name="RFP_SENT_DATE" Type="String" />
                                            <asp:Parameter Name="PROPOSAL_RECEIVED_DATE" Type="String" />
                                            <asp:Parameter Name="OFFER_STATUS" Type="String" />
                                            <asp:Parameter Name="COMMENT" Type="String" />
                                            <asp:Parameter Name="ID" Type="Int32" />
                                        </UpdateParameters>
                                    </asp:SqlDataSource>
                                    <asp:GridView ID="GridView5" runat="server" AutoGenerateColumns="False" 
                                        DataKeyNames="ID" DataSourceID="SqlDataSource8" EnableModelValidation="True">

                                        <Columns>
                                            <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
                                            <asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False" 
                                                ReadOnly="True" SortExpression="ID" Visible="false"/>
                                    
                                            <asp:TemplateField HeaderText="Retailer" SortExpression="RETAILER">
                                                <EditItemTemplate>
                                                    <asp:DropDownList ID="SelRETAILER" runat="server" 
                                                        SelectedValue='<%# Bind("RETAILER") %>'>
                                                        <asp:ListItem Value="">Select...</asp:ListItem>
                                                        <asp:ListItem Value="AGL">AGL</asp:ListItem>
                                                        <asp:ListItem Value="Alinta">Alinta</asp:ListItem>
                                                        <asp:ListItem Value="Aurora Energy Pty Ltd">Aurora Energy Pty Ltd</asp:ListItem>
                                                        <asp:ListItem Value="Australian Power and Gas">Australian Power and Gas</asp:ListItem>
                                                        <asp:ListItem Value="BlueNRG">BlueNRG</asp:ListItem>
                                                        <asp:ListItem Value="Click Energy">Click Energy</asp:ListItem>
                                                        <asp:ListItem Value="Cogent Energy">Cogent Energy</asp:ListItem>
                                                        <asp:ListItem Value="Essential Energy">Essential Energy</asp:ListItem>
                                                        <asp:ListItem Value="Country Energy">Country Energy</asp:ListItem>
                                                        <asp:ListItem Value="Delta Electricity">Delta Electricity</asp:ListItem>
                                                        <asp:ListItem Value="Diamond Energy">Diamond Energy</asp:ListItem>
                                                        <asp:ListItem Value="Dodo Power &amp; Gas">Dodo Power &amp; Gas</asp:ListItem>
                                                        <asp:ListItem Value="Energy Australia">Energy Australia</asp:ListItem>
                                                        <asp:ListItem Value="Ergon Energy Queensland">Ergon Energy Queensland</asp:ListItem>
                                                        <asp:ListItem Value="ERM Power Retail Pty Ltd">ERM Power Retail Pty Ltd</asp:ListItem>
                                                        <asp:ListItem Value="Eraring Energy">Eraring Energy</asp:ListItem>
                                                        <asp:ListItem Value="Essential Energy">Essential Energy</asp:ListItem>
                                                        <asp:ListItem Value="Flinders Power Holding GmbH">Flinders Power Holding GmbH</asp:ListItem>
                                                        <asp:ListItem Value="GridX Pty Ltd">GridX Pty Ltd</asp:ListItem>
                                                        <asp:ListItem Value="Independent Electricity Retail Solutions Pty Ltd">Independent Electricity Retail Solutions Pty Ltd</asp:ListItem>
                                                        <asp:ListItem Value="Integral Energy Australia">Integral Energy Australia</asp:ListItem>
                                                        <asp:ListItem Value="Lumo Energy">Lumo Energy</asp:ListItem>
                                                        <asp:ListItem Value="Momentum Energy">Momentum Energy</asp:ListItem>
                                                        <asp:ListItem Value="Neighbourhood Energy">Neighbourhood Energy</asp:ListItem>
                                                        <asp:ListItem Value="Origin Energy">Origin Energy</asp:ListItem>
                                                        <asp:ListItem Value="Powerdirect">Powerdirect</asp:ListItem>
                                                        <asp:ListItem Value="Qenergy">Qenergy</asp:ListItem>
                                                        <asp:ListItem Value="Red Energy">Red Energy</asp:ListItem>
                                                        <asp:ListItem Value="Sanctuary Energy">Sanctuary Energy</asp:ListItem>
                                                        <asp:ListItem Value="Simply Energy">Simply Energy</asp:ListItem>
                                                        <asp:ListItem Value="Tarong Energy">Tarong Energy </asp:ListItem>
                                                        <asp:ListItem Value="TRUenergy">TRUenergy</asp:ListItem>
                                                        <asp:ListItem Value="Trustpower Australia">Trustpower Australia</asp:ListItem>
                                                        <asp:ListItem Value="Victoria Electricity">Victoria Electricity</asp:ListItem>
                                                    </asp:DropDownList>



                                                </EditItemTemplate>
                                                <ItemTemplate>
                                                    <asp:Label ID="Label6" runat="server" Text='<%# Bind("RETAILER") %>'></asp:Label>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            
                                            <asp:TemplateField HeaderText="RFP Sent Date" SortExpression="RFP_SENT_DATE">
                                                <EditItemTemplate>
                                                    <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("RFP_SENT_DATE") %>'   onclick="WdatePicker()"></asp:TextBox>
                                                </EditItemTemplate>
                                                <ItemTemplate>
                                                    <asp:Label ID="Label2" runat="server" Text='<%# Bind("RFP_SENT_DATE") %>' ></asp:Label>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Proposal Received Date" 
                                                SortExpression="PROPOSAL_RECEIVED_DATE">
                                                <EditItemTemplate>
                                                    <asp:TextBox ID="TextBox2" runat="server" 
                                                        Text='<%# Bind("PROPOSAL_RECEIVED_DATE") %>'   onclick="WdatePicker()"></asp:TextBox>
                                                </EditItemTemplate>
                                                <ItemTemplate>
                                                    <asp:Label ID="Label3" runat="server" 
                                                        Text='<%# Bind("PROPOSAL_RECEIVED_DATE") %>'></asp:Label>
                                                </ItemTemplate>
                                            </asp:TemplateField>

                                            <asp:TemplateField HeaderText="Proposal Sent to Customer Date" SortExpression="PRICE_STATUS">
                                                <EditItemTemplate>
                                                    <asp:TextBox ID="PRICE_STATUS" runat="server" Text='<%# Bind("PRICE_STATUS") %>'  onclick="WdatePicker()"></asp:TextBox>
                                                </EditItemTemplate>
                                                <ItemTemplate>
                                                    <asp:Label ID="lblPRICE_STATUS" runat="server" Text='<%# Bind("PRICE_STATUS") %>'></asp:Label>
                                                </ItemTemplate>
                                            </asp:TemplateField>

                                            <asp:TemplateField HeaderText="Offer Status" SortExpression="OFFER_STATUS">
                                                <EditItemTemplate>

                                                    <asp:DropDownList ID="SelOFFER_STATUS" runat="server" SelectedValue='<%# Bind("OFFER_STATUS") %>'>
                                                        <asp:ListItem Value="">Select...</asp:ListItem>
                                                        <asp:ListItem>Waiting for retailer proposal</asp:ListItem>
                                                        <asp:ListItem>Proposal received from retailer</asp:ListItem>
                                                        <asp:ListItem>Proposal sent to customer</asp:ListItem>
                                                        <asp:ListItem>Customer accepted offer</asp:ListItem>
                                                        <asp:ListItem>Customer rejected offer</asp:ListItem>
                                                        <asp:ListItem>Retailer no bid</asp:ListItem>
                                                    </asp:DropDownList>

                                                </EditItemTemplate>
                                                <ItemTemplate>
                                                    <asp:Label ID="Label4" runat="server" Text='<%# Bind("OFFER_STATUS") %>'></asp:Label>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Price Feedback/Comment" SortExpression="COMMENT">
                                                <EditItemTemplate>
                                                    <asp:TextBox ID="RFPComments" Rows="2" cols="60" Width="260" runat="server" TextMode="MultiLine"
                                                    Text='<%# Bind("COMMENT") %>'></asp:TextBox>
                                                </EditItemTemplate>
                                                <ItemTemplate>
                                                    <asp:Label ID="Label1" runat="server" Text='<%# Bind("COMMENT") %>'></asp:Label>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                        </Columns>

                                    </asp:GridView>
                                    <asp:Button ID="btnAddRPF" runat="server" Text="Add" onclick="AddGasRPF_OnClick"/>
                                    <asp:Button ID="btnRPF" runat="server" Text="Export RPF" />
                                </EditItemTemplate>
                            </asp:TemplateField>

                                    <asp:CommandField ShowEditButton="True" />
                            
                        </Fields>
                        <PagerStyle CssClass="pgr" />
                    </asp:DetailsView>



            </asp:View>
        </asp:MultiView>
        <center><asp:Button ID="btnUpdate" runat="server" Text="Update All" 
            onclick="btnUpdate_Click" /></center>
                    <asp:SqlDataSource ID="SqlDataSource3" runat="server" 
                        ConnectionString="<%$ ConnectionStrings:SQLServer2005DBConnectionString %>" 
                        DeleteCommand="DELETE FROM [tblCI] WHERE [USERID] = @USERID" 
                        InsertCommand="INSERT INTO [tblCI] ([ELEC_CURRENT_RETAILER], [ELEC_PRICE_TYPE], [ELEC_CARBON_PRICE_OPTION], [ELEC_GREEN_ENERGY_REQUIREMENT], [ELEC_GREEN_ENERGY_PERCENT], [ELEC_CONTRACT_START_DATE], [ELEC_CONTRACT_TERM], [ELEC_INDIVIDUAL_YEAR_OPTION], [ELEC_CONTRACT_END_DATE], [ELEC_ALTER_END_DATE], [ELEC_PRICE_COB], [ELEC_DATA_PROVIDED], [ELEC_CUSTOMER_AUTH], [ELEC_CUSTOMER_AUTH_DATE]) VALUES (@ELEC_CURRENT_RETAILER, @ELEC_PRICE_TYPE, @ELEC_CARBON_PRICE_OPTION, @ELEC_GREEN_ENERGY_REQUIREMENT, @ELEC_GREEN_ENERGY_PERCENT, @ELEC_CONTRACT_START_DATE, @ELEC_CONTRACT_TERM, @ELEC_INDIVIDUAL_YEAR_OPTION, @ELEC_CONTRACT_END_DATE, @ELEC_ALTER_END_DATE, @ELEC_PRICE_COB, @ELEC_DATA_PROVIDED, @ELEC_CUSTOMER_AUTH, @ELEC_CUSTOMER_AUTH_DATE)" 
                        SelectCommand="SELECT [USERID], [ELEC_CURRENT_RETAILER], [ELEC_PRICE_TYPE], [ELEC_CARBON_PRICE_OPTION], [ELEC_GREEN_ENERGY_REQUIREMENT], [ELEC_GREEN_ENERGY_PERCENT], [ELEC_CONTRACT_START_DATE], [ELEC_CONTRACT_TERM], [ELEC_INDIVIDUAL_YEAR_OPTION], [ELEC_CONTRACT_END_DATE], [ELEC_ALTER_END_DATE], [ELEC_PRICE_COB], [ELEC_DATA_PROVIDED], [ELEC_CUSTOMER_AUTH], [ELEC_CUSTOMER_AUTH_DATE] FROM [tblCI] WHERE ([USERID] = @USERID)" 
                        
                        
                        UpdateCommand="UPDATE [tblCI] SET [ELEC_CURRENT_RETAILER] = @ELEC_CURRENT_RETAILER, [ELEC_PRICE_TYPE] = @ELEC_PRICE_TYPE, [ELEC_CARBON_PRICE_OPTION] = @ELEC_CARBON_PRICE_OPTION, [ELEC_GREEN_ENERGY_REQUIREMENT] = @ELEC_GREEN_ENERGY_REQUIREMENT, [ELEC_GREEN_ENERGY_PERCENT] = @ELEC_GREEN_ENERGY_PERCENT, [ELEC_CONTRACT_START_DATE] = @ELEC_CONTRACT_START_DATE, [ELEC_CONTRACT_TERM] = @ELEC_CONTRACT_TERM, [ELEC_INDIVIDUAL_YEAR_OPTION] = @ELEC_INDIVIDUAL_YEAR_OPTION, [ELEC_CONTRACT_END_DATE] = @ELEC_CONTRACT_END_DATE, [ELEC_ALTER_END_DATE] = @ELEC_ALTER_END_DATE, [ELEC_PRICE_COB] = @ELEC_PRICE_COB, [ELEC_DATA_PROVIDED] = @ELEC_DATA_PROVIDED, [ELEC_CUSTOMER_AUTH] = @ELEC_CUSTOMER_AUTH, [ELEC_CUSTOMER_AUTH_DATE] = @ELEC_CUSTOMER_AUTH_DATE WHERE [USERID] = @USERID">
                        <DeleteParameters>
                            <asp:Parameter Name="USERID" Type="Int32" />
                        </DeleteParameters>
                        <InsertParameters>
                            <asp:Parameter Name="ELEC_CURRENT_RETAILER" Type="String" />
                            <asp:Parameter Name="ELEC_PRICE_TYPE" Type="String" />
                            <asp:Parameter Name="ELEC_CARBON_PRICE_OPTION" Type="String" />
                            <asp:Parameter Name="ELEC_GREEN_ENERGY_REQUIREMENT" Type="String" />
                            <asp:Parameter Name="ELEC_GREEN_ENERGY_PERCENT" Type="String" />
                            <asp:Parameter Name="ELEC_CONTRACT_START_DATE" Type="String" />
                            <asp:Parameter Name="ELEC_CONTRACT_TERM" Type="String" />
                            <asp:Parameter Name="ELEC_INDIVIDUAL_YEAR_OPTION" Type="String" />
                            <asp:Parameter Name="ELEC_CONTRACT_END_DATE" Type="String" />
                            <asp:Parameter Name="ELEC_ALTER_END_DATE" Type="String" />
                            <asp:Parameter Name="ELEC_PRICE_COB" Type="String" />
                            <asp:Parameter Name="ELEC_DATA_PROVIDED" Type="String" />
                            <asp:Parameter Name="ELEC_CUSTOMER_AUTH" Type="String" />
                            <asp:Parameter Name="ELEC_CUSTOMER_AUTH_DATE" Type="String" />
                        </InsertParameters>
                        <SelectParameters>
                            <asp:ControlParameter ControlID="GridView1" Name="USERID" 
                                PropertyName="SelectedValue" Type="Int32" />
                        </SelectParameters>
                        <UpdateParameters>
                            <asp:Parameter Name="ELEC_CURRENT_RETAILER" Type="String" />
                            <asp:Parameter Name="ELEC_PRICE_TYPE" Type="String" />
                            <asp:Parameter Name="ELEC_CARBON_PRICE_OPTION" Type="String" />
                            <asp:Parameter Name="ELEC_GREEN_ENERGY_REQUIREMENT" Type="String" />
                            <asp:Parameter Name="ELEC_GREEN_ENERGY_PERCENT" Type="String" />
                            <asp:Parameter Name="ELEC_CONTRACT_START_DATE" Type="String" />
                            <asp:Parameter Name="ELEC_CONTRACT_TERM" Type="String" />
                            <asp:Parameter Name="ELEC_INDIVIDUAL_YEAR_OPTION" Type="String" />
                            <asp:Parameter Name="ELEC_CONTRACT_END_DATE" Type="String" />
                            <asp:Parameter Name="ELEC_ALTER_END_DATE" Type="String" />
                            <asp:Parameter Name="ELEC_PRICE_COB" Type="String" />
                            <asp:Parameter Name="ELEC_DATA_PROVIDED" Type="String" />
                            <asp:Parameter Name="ELEC_CUSTOMER_AUTH" Type="String" />
                            <asp:Parameter Name="ELEC_CUSTOMER_AUTH_DATE" Type="String" />
                            <asp:Parameter Name="USERID" Type="Int32" />
                        </UpdateParameters>
                    </asp:SqlDataSource>
                    <asp:SqlDataSource ID="SqlDataSource4" runat="server" 
                        ConnectionString="<%$ ConnectionStrings:SQLServer2005DBConnectionString %>" 
                        DeleteCommand="DELETE FROM [tblCI] WHERE [USERID] = @USERID" 
                        InsertCommand="INSERT INTO [tblCI] ([GAS_CURRENT_RETAILER], [GAS_PRICE_TYPE], [GAS_CONTRACT_START_DATE], [GAS_CONTRACT_TERM], [GAS_INDIVIDUAL_YEAR_OPTION], [GAS_CONTRACT_END_DATE], [GAS_ALTER_END_DATE], [GAS_PRICE_COB], [GAS_DATA_PROVIDED], [GAS_CUSTOMER_AUTH], [GAS_CUSTOMER_AUTH_DATE]) VALUES (@GAS_CURRENT_RETAILER, @GAS_PRICE_TYPE, @GAS_CONTRACT_START_DATE, @GAS_CONTRACT_TERM, @GAS_INDIVIDUAL_YEAR_OPTION, @GAS_CONTRACT_END_DATE, @GAS_ALTER_END_DATE, @GAS_PRICE_COB, @GAS_DATA_PROVIDED, @GAS_CUSTOMER_AUTH, @GAS_CUSTOMER_AUTH_DATE)" 
                        SelectCommand="SELECT [USERID], [GAS_CURRENT_RETAILER], [GAS_PRICE_TYPE], [GAS_CONTRACT_START_DATE], [GAS_CONTRACT_TERM], [GAS_INDIVIDUAL_YEAR_OPTION], [GAS_CONTRACT_END_DATE], [GAS_ALTER_END_DATE], [GAS_PRICE_COB], [GAS_DATA_PROVIDED], [GAS_CUSTOMER_AUTH], [GAS_CUSTOMER_AUTH_DATE] FROM [tblCI] WHERE ([USERID] = @USERID)" 
                        
                        
                        
                        UpdateCommand="UPDATE [tblCI] SET [GAS_CURRENT_RETAILER] = @GAS_CURRENT_RETAILER, [GAS_PRICE_TYPE] = @GAS_PRICE_TYPE, [GAS_CONTRACT_START_DATE] = @GAS_CONTRACT_START_DATE, [GAS_CONTRACT_TERM] = @GAS_CONTRACT_TERM, [GAS_INDIVIDUAL_YEAR_OPTION] = @GAS_INDIVIDUAL_YEAR_OPTION, [GAS_CONTRACT_END_DATE] = @GAS_CONTRACT_END_DATE, [GAS_ALTER_END_DATE] = @GAS_ALTER_END_DATE, [GAS_PRICE_COB] = @GAS_PRICE_COB, [GAS_DATA_PROVIDED] = @GAS_DATA_PROVIDED, [GAS_CUSTOMER_AUTH] = @GAS_CUSTOMER_AUTH, [GAS_CUSTOMER_AUTH_DATE] = @GAS_CUSTOMER_AUTH_DATE WHERE [USERID] = @USERID">
                        <DeleteParameters>
                            <asp:Parameter Name="USERID" Type="Int32" />
                        </DeleteParameters>
                        <InsertParameters>
                            <asp:Parameter Name="GAS_CURRENT_RETAILER" Type="String" />
                            <asp:Parameter Name="GAS_PRICE_TYPE" Type="String" />
                            <asp:Parameter Name="GAS_CONTRACT_START_DATE" Type="String" />
                            <asp:Parameter Name="GAS_CONTRACT_TERM" Type="String" />
                            <asp:Parameter Name="GAS_INDIVIDUAL_YEAR_OPTION" Type="String" />
                            <asp:Parameter Name="GAS_CONTRACT_END_DATE" Type="String" />
                            <asp:Parameter Name="GAS_ALTER_END_DATE" Type="String" />
                            <asp:Parameter Name="GAS_PRICE_COB" Type="String" />
                            <asp:Parameter Name="GAS_DATA_PROVIDED" Type="String" />
                            <asp:Parameter Name="GAS_CUSTOMER_AUTH" Type="String" />
                            <asp:Parameter Name="GAS_CUSTOMER_AUTH_DATE" Type="String" />
                        </InsertParameters>
                        <SelectParameters>
                            <asp:ControlParameter ControlID="GridView1" Name="USERID" 
                                PropertyName="SelectedValue" Type="Int32" />
                        </SelectParameters>
                        <UpdateParameters>
                            <asp:Parameter Name="GAS_CURRENT_RETAILER" Type="String" />
                            <asp:Parameter Name="GAS_PRICE_TYPE" Type="String" />
                            <asp:Parameter Name="GAS_CONTRACT_START_DATE" Type="String" />
                            <asp:Parameter Name="GAS_CONTRACT_TERM" Type="String" />
                            <asp:Parameter Name="GAS_INDIVIDUAL_YEAR_OPTION" Type="String" />
                            <asp:Parameter Name="GAS_CONTRACT_END_DATE" Type="String" />
                            <asp:Parameter Name="GAS_ALTER_END_DATE" Type="String" />
                            <asp:Parameter Name="GAS_PRICE_COB" Type="String" />
                            <asp:Parameter Name="GAS_DATA_PROVIDED" Type="String" />
                            <asp:Parameter Name="GAS_CUSTOMER_AUTH" Type="String" />
                            <asp:Parameter Name="GAS_CUSTOMER_AUTH_DATE" Type="String" />
                            <asp:Parameter Name="USERID" Type="Int32" />
                        </UpdateParameters>
                    </asp:SqlDataSource>


                    <asp:SqlDataSource ID="SqlDataSource35" runat="server" 
                    ConnectionString='<%$ ConnectionStrings:SQLServer2005DBConnectionString %>'
                    SelectCommand="Select * FROM tblPromotionCode">
                    </asp:SqlDataSource>

                    <asp:SqlDataSource ID="SqlDataSource36" runat="server" 
                    ConnectionString='<%$ ConnectionStrings:SQLServer2005DBConnectionString %>'
                    SelectCommand="Select * FROM tblOperator">
                    </asp:SqlDataSource>

    </div>
    </form>
</body>

<script src="http://ajax.microsoft.com/ajax/jquery/jquery-1.4.2.min.js" type="text/javascript"></script>
<script src="date.f-0.5.0-min.js" type="text/javascript"></script>
<script src="ci.js" type="text/javascript"></script>
</html>
